diff --git a/Procfile b/Procfile index be50bed..554ecaa 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn amadeus.wsgi:application --log-file - \ No newline at end of file +web: gunicorn amadeus.wsgi --log-file - \ No newline at end of file diff --git a/amadeus/settings.py b/amadeus/settings.py index 208de1e..19ac97a 100644 --- a/amadeus/settings.py +++ b/amadeus/settings.py @@ -19,7 +19,7 @@ db_from_ev = dj_database_url.config(conn_max_age=500) # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - +PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) # Quick-start development settings - unsuitable for production # 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__))) SECRET_KEY = '$=8)c!5)iha85a&8q4+kv1pyg0yl7_xe_x^z=2cn_1d7r0hny4' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = [] @@ -57,6 +57,7 @@ INSTALLED_APPS = [ MIDDLEWARE_CLASSES = [ 'django.middleware.security.SecurityMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -97,9 +98,8 @@ WSGI_APPLICATION = 'amadeus.wsgi.application' # Database # https://docs.djangopr/*oject.com/en/1.9/ref/settings/#databases -DATABASES = { - 'default': db_from_ev -} +DATABASES = ['default'].update(db_from_ev) + #superuser: admin pass: amadeus2358 @@ -143,7 +143,7 @@ USE_TZ = True STATIC_URL = '/static/' #Static files heroku -STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') +STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles') STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' @@ -151,10 +151,17 @@ STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static") ] +#SECURITY +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO','https') + +#Allow all host headers +ALLOWED_HOSTS = ['*'] + # Files MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'uploads') MEDIA_URL = '/uploads/' + # Users LOGIN_REDIRECT_URL = 'app:index' LOGIN_URL = 'core:home' diff --git a/poll/static/sample.txt b/poll/static/sample.txt new file mode 100644 index 0000000..2aab7b9 --- /dev/null +++ b/poll/static/sample.txt @@ -0,0 +1 @@ +THIS FILE WAS CREATED TO TEST PURPOSES ON HEROKU. \ No newline at end of file diff --git a/staticfiles/sample.txt b/staticfiles/sample.txt new file mode 100644 index 0000000..2aab7b9 --- /dev/null +++ b/staticfiles/sample.txt @@ -0,0 +1 @@ +THIS FILE WAS CREATED TO TEST PURPOSES ON HEROKU. \ No newline at end of file -- libgit2 0.21.2