Last active
December 19, 2015 15:48
-
-
Save kennethreitz/5978523 to your computer and use it in GitHub Desktop.
This file contains 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
# Parse database configuration from $DATABASE_URL | |
import dj_database_url | |
DATABASES['default'] = dj_database_url.config() | |
# Honor the 'X-Forwarded-Proto' header for request.is_secure() | |
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') | |
# Allow all host headers | |
ALLOWED_HOSTS = ['*'] | |
# Static asset configuration | |
import os | |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) | |
STATIC_ROOT = 'staticfiles' | |
STATIC_URL = '/static/' | |
STATICFILES_DIRS = ( | |
os.path.join(PROJECT_PATH, 'static'), | |
) |
This file contains 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
from django.core.wsgi import get_wsgi_application | |
from django.contrib.staticfiles.handlers import StaticFilesHandler | |
# Serve static assets | |
application = StaticFilesHandler(get_wsgi_application()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment