diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..7144a43 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: python manage.py makemigrations && python manage.py migrate && gunicorn hc.wsgi --log-file - diff --git a/hc/settings.py b/hc/settings.py index adecc23..d8f8128 100644 --- a/hc/settings.py +++ b/hc/settings.py @@ -12,13 +12,14 @@ import os import warnings +import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) HOST = "localhost" -SECRET_KEY = "---" +SECRET_KEY = os.getenv('SECRET_KEY') DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] DEFAULT_FROM_EMAIL = 'healthchecks@example.org' USE_PAYMENTS = False @@ -110,6 +111,10 @@ } } +# Update database configuration with $DATABASE_URL. +if os.environ.get("HOST") == "HEROKU": + DATABASES['default'] = dj_database_url.config() + LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' diff --git a/hc/wsgi.py b/hc/wsgi.py index 4a9bf89..3be431c 100644 --- a/hc/wsgi.py +++ b/hc/wsgi.py @@ -10,7 +10,9 @@ import os from django.core.wsgi import get_wsgi_application +from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hc.settings") application = get_wsgi_application() +application = DjangoWhiteNoise(application) diff --git a/requirements.txt b/requirements.txt index c21bee1..9e98e17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,12 @@ +dj-database-url==0.4.2 django-appconf==1.0.1 -django-ses-backend==0.1.1 Django==1.10 -django_compressor==2.1 +django-compressor==2.1 +django-ses-backend==0.1.1 djmail==0.11.0 futures==3.0.3 +gunicorn==19.7.1 premailer==2.9.6 psycopg2==2.6.1 requests==2.9.1 +whitenoise==3.3.0