diff options
author | Weitian LI <liweitianux@gmail.com> | 2014-04-28 23:52:38 +0800 |
---|---|---|
committer | Weitian LI <liweitianux@gmail.com> | 2014-04-28 23:52:38 +0800 |
commit | c3dd549d0001151333d1daf82a358b64a46fad29 (patch) | |
tree | 1264438be2fed65e262b553b1c44dd7fedc37dab | |
parent | 204c5922ba5492bc69d5443388c30f7633fe03e2 (diff) | |
download | django-skaschool-c3dd549d0001151333d1daf82a358b64a46fad29.tar.bz2 |
* updated settings with 'ALLOWED_HOSTS'
* updated MEDIA_ROOT and STATIC_ROOT of settings_production.py
-rw-r--r-- | django_skaschool/settings.py | 2 | ||||
-rw-r--r-- | django_skaschool/settings_mysql.py | 2 | ||||
-rw-r--r-- | django_skaschool/settings_production.py | 15 |
3 files changed, 16 insertions, 3 deletions
diff --git a/django_skaschool/settings.py b/django_skaschool/settings.py index 7a20a0f..9b4c779 100644 --- a/django_skaschool/settings.py +++ b/django_skaschool/settings.py @@ -25,6 +25,8 @@ DEBUG = True TEMPLATE_DEBUG = True +# ALLOWED_HOSTS is required when deploying with DEBUG=False, +# otherwise server will throw 400 bad request errors. ALLOWED_HOSTS = [] diff --git a/django_skaschool/settings_mysql.py b/django_skaschool/settings_mysql.py index c941f0f..e22444b 100644 --- a/django_skaschool/settings_mysql.py +++ b/django_skaschool/settings_mysql.py @@ -25,6 +25,8 @@ DEBUG = True TEMPLATE_DEBUG = True +# ALLOWED_HOSTS is required when deploying with DEBUG=False, +# otherwise server will throw 400 bad request errors. ALLOWED_HOSTS = [] diff --git a/django_skaschool/settings_production.py b/django_skaschool/settings_production.py index bcec886..4c1533e 100644 --- a/django_skaschool/settings_production.py +++ b/django_skaschool/settings_production.py @@ -25,7 +25,16 @@ DEBUG = False TEMPLATE_DEBUG = False -ALLOWED_HOSTS = [] +# ALLOWED_HOSTS is required when deploying with DEBUG=False, +# otherwise server will throw 400 bad request errors. +ALLOWED_HOSTS = [ + 'localhost', + '127.0.0.1', + '202.120.52.45', + '202.120.52.18', + '.physics.sjtu.edu.cn', + '.sjtu.edu.cn', +] # Application definition @@ -135,7 +144,7 @@ STATICFILES_DIRS = ( # absolute path to the directory where 'collectstatic' will collect # static files for deployment #STATIC_ROOT = '/var/www/example.com/static/' -STATIC_ROOT = os.path.join(BASE_DIR, 'static_root') +STATIC_ROOT = os.path.join(BASE_DIR, '../static_root') # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ @@ -144,7 +153,7 @@ STATIC_URL = '/static/' ## media root # absolute filesystem path to the directory that hold user-uploaded files #MEDIA_ROOT = '/var/www/example.com/media/' -MEDIA_ROOT = os.path.join(BASE_DIR, 'media_root') +MEDIA_ROOT = os.path.join(BASE_DIR, '../media_root') # media url MEDIA_URL = '/media/' |