Commit 861cc86c3fc0ad8970c9408d86c355d5dd7efab3
1 parent
2003d55e
Exists in
master
and in
5 other branches
created staticfiles folder and modified settings.py
Showing
4 changed files
with
16 additions
and
7 deletions
Show diff stats
Procfile
amadeus/settings.py
... | ... | @@ -19,7 +19,7 @@ db_from_ev = dj_database_url.config(conn_max_age=500) |
19 | 19 | |
20 | 20 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
21 | 21 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
22 | - | |
22 | +PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) | |
23 | 23 | |
24 | 24 | # Quick-start development settings - unsuitable for production |
25 | 25 | # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ |
... | ... | @@ -28,7 +28,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
28 | 28 | SECRET_KEY = '$=8)c!5)iha85a&8q4+kv1pyg0yl7_xe_x^z=2cn_1d7r0hny4' |
29 | 29 | |
30 | 30 | # SECURITY WARNING: don't run with debug turned on in production! |
31 | -DEBUG = True | |
31 | +DEBUG = False | |
32 | 32 | |
33 | 33 | ALLOWED_HOSTS = [] |
34 | 34 | |
... | ... | @@ -57,6 +57,7 @@ INSTALLED_APPS = [ |
57 | 57 | |
58 | 58 | MIDDLEWARE_CLASSES = [ |
59 | 59 | 'django.middleware.security.SecurityMiddleware', |
60 | + 'whitenoise.middleware.WhiteNoiseMiddleware', | |
60 | 61 | 'django.contrib.sessions.middleware.SessionMiddleware', |
61 | 62 | 'django.middleware.common.CommonMiddleware', |
62 | 63 | 'django.middleware.csrf.CsrfViewMiddleware', |
... | ... | @@ -97,9 +98,8 @@ WSGI_APPLICATION = 'amadeus.wsgi.application' |
97 | 98 | # Database |
98 | 99 | # https://docs.djangopr/*oject.com/en/1.9/ref/settings/#databases |
99 | 100 | |
100 | -DATABASES = { | |
101 | - 'default': db_from_ev | |
102 | -} | |
101 | +DATABASES = ['default'].update(db_from_ev) | |
102 | + | |
103 | 103 | |
104 | 104 | |
105 | 105 | #superuser: admin pass: amadeus2358 |
... | ... | @@ -143,7 +143,7 @@ USE_TZ = True |
143 | 143 | STATIC_URL = '/static/' |
144 | 144 | |
145 | 145 | #Static files heroku |
146 | -STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') | |
146 | +STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles') | |
147 | 147 | |
148 | 148 | STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' |
149 | 149 | |
... | ... | @@ -151,10 +151,17 @@ STATICFILES_DIRS = [ |
151 | 151 | os.path.join(BASE_DIR, "static") |
152 | 152 | ] |
153 | 153 | |
154 | +#SECURITY | |
155 | +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO','https') | |
156 | + | |
157 | +#Allow all host headers | |
158 | +ALLOWED_HOSTS = ['*'] | |
159 | + | |
154 | 160 | # Files |
155 | 161 | MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'uploads') |
156 | 162 | MEDIA_URL = '/uploads/' |
157 | 163 | |
164 | + | |
158 | 165 | # Users |
159 | 166 | LOGIN_REDIRECT_URL = 'app:index' |
160 | 167 | LOGIN_URL = 'core:home' | ... | ... |