File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ applications :
3+ - name : ih-superlists
4+ memory : 512M
5+ instances : 1
6+ buildpack : python_buildpack
7+ command : python manage.py collectstatic --noinput && gunicorn superlists.wsgi:application
Original file line number Diff line number Diff line change 11django == 1.11
22gunicorn == 19.7.1
3+ whitenoise == 3.3.1
4+ dj-database-url == 0.4.2
5+ psycopg2 == 2.7.3.1
Original file line number Diff line number Diff line change 1+ python-3.6.2
Original file line number Diff line number Diff line change 1111"""
1212
1313import os
14+ import dj_database_url
1415
1516# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1617BASE_DIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
2324SECRET_KEY = 's&fct_9our6wa6!kk70lsfs#sqp=%225kz5%0)u7x4$@**y+l)'
2425
2526# SECURITY WARNING: don't run with debug turned on in production!
26- DEBUG = True
2727
28- ALLOWED_HOSTS = []
28+ DEBUG = False
29+
30+ ALLOWED_HOSTS = ['ih-superlists.cfapps.io' ]
2931
3032
3133# Application definition
4244
4345MIDDLEWARE = [
4446 'django.middleware.security.SecurityMiddleware' ,
47+ 'whitenoise.middleware.WhiteNoiseMiddleware' ,
4548 'django.contrib.sessions.middleware.SessionMiddleware' ,
4649 'django.middleware.common.CommonMiddleware' ,
4750 'django.middleware.csrf.CsrfViewMiddleware' ,
7477# Database
7578# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
7679
77- DATABASES = {
78- 'default' : {
79- 'ENGINE' : 'django.db.backends.sqlite3' ,
80- 'NAME' : os .path .join (BASE_DIR , 'db.sqlite3' ),
81- }
82- }
80+
81+ #DATABASES = {
82+ # 'default': {
83+ # 'ENGINE': 'django.db.backends.sqlite3',
84+ # 'NAME': os.path.join(BASE_DIR, '../database/db.sqlite3'),
85+ # }
86+ #}
87+ print ("DATABASE_URL=" + os .environ .get ('DATABASE_URL' , 'NOT_SPECIFIED' ))
88+ LOCAL_SQLITE = 'sqlite:///' + os .path .abspath (os .path .join (BASE_DIR , '../database/db.sqlite3' ))
89+ DATABASES = {}
90+ DATABASES ['default' ] = dj_database_url .config (default = LOCAL_SQLITE )
8391
8492
8593# Password validation
You can’t perform that action at this time.
0 commit comments