Use dj_database_url properly
This commit is contained in:
parent
85426d4c26
commit
cffee02043
2 changed files with 2 additions and 9 deletions
|
@ -98,16 +98,8 @@ WSGI_APPLICATION = 'project.wsgi.application'
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
||||||
|
|
||||||
if 'DATABASE_URL' in os.environ:
|
|
||||||
DATABASE_CONFIG = dj_database_url.config(default=os.environ['DATABASE_URL'], conn_max_age=300)
|
|
||||||
else:
|
|
||||||
DATABASE_CONFIG = {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
||||||
}
|
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': DATABASE_CONFIG
|
'default': dj_database_url.config(default="sqlite:///{}/db.sqlite3".format(BASE_DIR), conn_max_age=300)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ dj_database_url==0.4.1
|
||||||
Django>=1.10,<1.11
|
Django>=1.10,<1.11
|
||||||
flake8==3.2.1
|
flake8==3.2.1
|
||||||
honcho==0.7.1
|
honcho==0.7.1
|
||||||
|
psycopg2==2.6.2
|
||||||
pygments-style-github==0.4
|
pygments-style-github==0.4
|
||||||
wagtail>=1.7,<1.8
|
wagtail>=1.7,<1.8
|
||||||
waitress==1.0.1
|
waitress==1.0.1
|
||||||
|
|
Reference in a new issue