Last active
April 18, 2018 14:38
-
-
Save palewire/02e66b48e19e78ed08468f380b1317d0 to your computer and use it in GitHub Desktop.
django-heroku-important-bits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
project/settings_dev.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
release: ./release.sh | |
web: gunicorn project.wsgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python manage.py migrate; | |
python manage.py collectstatic --noinput; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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