Skip to content

Instantly share code, notes, and snippets.

@wowkin2
Created July 11, 2015 13:24
Show Gist options
  • Save wowkin2/10bc1a9d25edf00f831c to your computer and use it in GitHub Desktop.
Save wowkin2/10bc1a9d25edf00f831c to your computer and use it in GitHub Desktop.
# ##############################################
# HEROKU DEPLOYMENT
# ##############################################
# 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
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, '..', 'static'),
)
DEBUG = False
# ##############################################
# For work with development/production settings
# ##############################################
try:
from .local_settings import *
except ImportError:
pass
# ##############################################
# MongoDB section (only if you use MongoDB)
# ##############################################
if DEBUG is True:
DB_SERVER = 'localhost'
DB_PORT = 27017
DB_NAME_DEFAULT = 'Database_Name'
DB_CREDENTIALS = {}
else:
DB_SERVER = 'ds012345.mongolab.com'
DB_PORT = 53972
DB_NAME_DEFAULT = 'heroku_123456'
DB_CREDENTIALS = {
'user': "db_user",
'password': "some_password"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment