Commit 861cc86c3fc0ad8970c9408d86c355d5dd7efab3

Authored by fbormann
1 parent 2003d55e

created staticfiles folder and modified settings.py

1 -web: gunicorn amadeus.wsgi:application --log-file -  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +web: gunicorn amadeus.wsgi --log-file -
3 \ No newline at end of file 3 \ No newline at end of file
amadeus/settings.py
@@ -19,7 +19,7 @@ db_from_ev = dj_database_url.config(conn_max_age=500) @@ -19,7 +19,7 @@ db_from_ev = dj_database_url.config(conn_max_age=500)
19 19
20 # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 20 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
21 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 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 # Quick-start development settings - unsuitable for production 24 # Quick-start development settings - unsuitable for production
25 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ 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,7 +28,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
28 SECRET_KEY = '$=8)c!5)iha85a&8q4+kv1pyg0yl7_xe_x^z=2cn_1d7r0hny4' 28 SECRET_KEY = '$=8)c!5)iha85a&8q4+kv1pyg0yl7_xe_x^z=2cn_1d7r0hny4'
29 29
30 # SECURITY WARNING: don't run with debug turned on in production! 30 # SECURITY WARNING: don't run with debug turned on in production!
31 -DEBUG = True 31 +DEBUG = False
32 32
33 ALLOWED_HOSTS = [] 33 ALLOWED_HOSTS = []
34 34
@@ -57,6 +57,7 @@ INSTALLED_APPS = [ @@ -57,6 +57,7 @@ INSTALLED_APPS = [
57 57
58 MIDDLEWARE_CLASSES = [ 58 MIDDLEWARE_CLASSES = [
59 'django.middleware.security.SecurityMiddleware', 59 'django.middleware.security.SecurityMiddleware',
  60 + 'whitenoise.middleware.WhiteNoiseMiddleware',
60 'django.contrib.sessions.middleware.SessionMiddleware', 61 'django.contrib.sessions.middleware.SessionMiddleware',
61 'django.middleware.common.CommonMiddleware', 62 'django.middleware.common.CommonMiddleware',
62 'django.middleware.csrf.CsrfViewMiddleware', 63 'django.middleware.csrf.CsrfViewMiddleware',
@@ -97,9 +98,8 @@ WSGI_APPLICATION = 'amadeus.wsgi.application' @@ -97,9 +98,8 @@ WSGI_APPLICATION = 'amadeus.wsgi.application'
97 # Database 98 # Database
98 # https://docs.djangopr/*oject.com/en/1.9/ref/settings/#databases 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 #superuser: admin pass: amadeus2358 105 #superuser: admin pass: amadeus2358
@@ -143,7 +143,7 @@ USE_TZ = True @@ -143,7 +143,7 @@ USE_TZ = True
143 STATIC_URL = '/static/' 143 STATIC_URL = '/static/'
144 144
145 #Static files heroku 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 STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' 148 STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
149 149
@@ -151,10 +151,17 @@ STATICFILES_DIRS = [ @@ -151,10 +151,17 @@ STATICFILES_DIRS = [
151 os.path.join(BASE_DIR, "static") 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 # Files 160 # Files
155 MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'uploads') 161 MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'uploads')
156 MEDIA_URL = '/uploads/' 162 MEDIA_URL = '/uploads/'
157 163
  164 +
158 # Users 165 # Users
159 LOGIN_REDIRECT_URL = 'app:index' 166 LOGIN_REDIRECT_URL = 'app:index'
160 LOGIN_URL = 'core:home' 167 LOGIN_URL = 'core:home'
poll/static/sample.txt 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +THIS FILE WAS CREATED TO TEST PURPOSES ON HEROKU.
0 \ No newline at end of file 2 \ No newline at end of file
staticfiles/sample.txt 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +THIS FILE WAS CREATED TO TEST PURPOSES ON HEROKU.
0 \ No newline at end of file 2 \ No newline at end of file