Skip to content

Instantly share code, notes, and snippets.

@palewire
Last active April 18, 2018 14:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palewire/02e66b48e19e78ed08468f380b1317d0 to your computer and use it in GitHub Desktop.
Save palewire/02e66b48e19e78ed08468f380b1317d0 to your computer and use it in GitHub Desktop.
django-heroku-important-bits
*.pyc
project/settings_dev.py
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
[packages]
django = "==1.11"
gunicorn = "*"
django-heroku = "*"
whitenoise = "*"
dj-database-url = "*"
[requires]
python_version = "2.7"
release: ./release.sh
web: gunicorn project.wsgi
python manage.py migrate;
python manage.py collectstatic --noinput;
# All the other crap above this
STATIC_URL = '/static/'
STATIC_ROOT = ".static"
# ENV specific settings
try:
from .settings_dev import *
DEBUG = True
except ImportError:
DEBUG = False
DATABASES = {
'default': {}
}
import dj_database_url
DATABASES['default'].update(dj_database_url.config())
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from whitenoise.django import DjangoWhiteNoise
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
application = DjangoWhiteNoise(application)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment