DATABASE_URL as ENV_VAR

This commit is contained in:
Sachi King 2017-06-24 15:58:33 +10:00
parent 65033b0937
commit f07b20aebd
3 changed files with 5 additions and 6 deletions

View file

@ -3,3 +3,4 @@
export DJANGO_SECRET_KEY=`uuidgen -r` export DJANGO_SECRET_KEY=`uuidgen -r`
export STRIPE_PUBLIC_KEY=`uuidgen -r` export STRIPE_PUBLIC_KEY=`uuidgen -r`
export STRIPE_SECRET_KEY=`uuidgen -r` export STRIPE_SECRET_KEY=`uuidgen -r`
export DATABASE_URL='sqlite:////tmp/symposion.sqlite'

View file

@ -2,6 +2,7 @@ import os
import sys import sys
import django import django
import dj_database_url
import saml2 import saml2
import saml2.saml import saml2.saml
@ -27,12 +28,8 @@ else:
sys.exit('DEBUG env var is in unexpected format. Should be a string' sys.exit('DEBUG env var is in unexpected format. Should be a string'
'containing either a 0 or a 1 - Got type %s' % type(DEBUG)) 'containing either a 0 or a 1 - Got type %s' % type(DEBUG))
DATABASES = { DATABASES['default'] = dj_database_url.config(conn_max_age=600)
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(PROJECT_ROOT, "dev.db"),
}
}
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
THEME_CONTACT_EMAIL = os.environ.get('THEME_CONTACT_EMAIL', None) THEME_CONTACT_EMAIL = os.environ.get('THEME_CONTACT_EMAIL', None)
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', None) SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', None)

View file

@ -7,6 +7,7 @@ dj-database-url==0.4.0
pylibmc==1.5.1 pylibmc==1.5.1
django-debug-toolbar>=1.7 django-debug-toolbar>=1.7
django-bootstrap-form django-bootstrap-form
dj-database-url
djangosaml2 djangosaml2
django-gapc-storage django-gapc-storage