Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Staging/ Production deployment #4

Merged
merged 1 commit into from
Jul 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: python manage.py makemigrations && python manage.py migrate && gunicorn hc.wsgi --log-file -
9 changes: 7 additions & 2 deletions hc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions hc/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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