Skip to content

Commit f9a939d

Browse files
author
liangliangyy
committed
修改配置
1 parent 488b122 commit f9a939d

260 files changed

Lines changed: 66110 additions & 8 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DjangoBlog/settings.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
# SECURITY WARNING: don't run with debug turned on in production!
2525
DEBUG = True
2626

27-
ALLOWED_HOSTS = []
28-
27+
#ALLOWED_HOSTS = []
28+
ALLOWED_HOSTS = ['blog.lylinux.org','127.0.0.1']
2929
# Application definition
3030

3131
INSTALLED_APPS = [
@@ -86,7 +86,7 @@
8686
'NAME': 'djangoblog',
8787
'USER': 'root',
8888
'PASSWORD': 'root',
89-
'HOST': '192.168.33.10',
89+
'HOST': '127.0.0.1',
9090
'PORT': 3306,
9191
}
9292
}
@@ -125,6 +125,12 @@
125125
# Static files (CSS, JavaScript, Images)
126126
# https://docs.djangoproject.com/en/1.10/howto/static-files/
127127

128+
129+
SITE_ROOT = os.path.dirname(os.path.abspath(__file__))
130+
SITE_ROOT = os.path.abspath(os.path.join(SITE_ROOT, '../'))
131+
132+
STATIC_ROOT = os.path.join(SITE_ROOT, 'collectedstatic')
133+
128134
STATIC_URL = '/static/'
129135
STATICFILES = os.path.join(BASE_DIR, 'static')
130136

@@ -155,4 +161,4 @@
155161
'LOCATION': '192.168.21.130:11211',
156162
}
157163
}
158-
"""
164+
"""

bin/django_start

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
NAME="djangoblog" # Name of the application
44
DJANGODIR=//var/www/DjangoBlog # Django project directory
55
SOCKFILE=/var/www/DjangoBlog/run/gunicorn.sock # we will communicte using this unix socket
6-
USER=root # the user to run as
7-
GROUP=root # the group to run as
8-
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
6+
USER=www-data # the user to run as
7+
GROUP=www-data # the group to run as
8+
NUM_WORKERS=2 # how many worker processes should Gunicorn spawn
99
DJANGO_SETTINGS_MODULE=DjangoBlog.settings # which settings file should Django use
1010
DJANGO_WSGI_MODULE=DjangoBlog.wsgi # WSGI module name
1111

@@ -23,7 +23,7 @@ test -d $RUNDIR || mkdir -p $RUNDIR
2323

2424
# Start your Django Unicorn
2525
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
26-
exec /root/dev/python3/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
26+
exec /var/www/dev/python3/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
2727
--name $NAME \
2828
--workers $NUM_WORKERS \
2929
--user=$USER --group=$GROUP \

0 commit comments

Comments
 (0)