Commit 4a863b52 authored by Ken Cochrane's avatar Ken Cochrane

made it so that the compile doesn't fail if the DATABASES variable doesn't exist in settings.py

parent 47d889c1
......@@ -94,8 +94,16 @@ import os, sys, urlparse
urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('mysql')
try:
if os.environ.has_key('DATABASE_URL') and DATABASES != None:
#check to make sure DATABASES is set in settings.py file.If not default to {}
try:
DATABASES
except NameError:
DATABASES = {}
if os.environ.has_key('DATABASE_URL'):
url = urlparse.urlparse(os.environ['DATABASE_URL'])
DATABASES['default'] = {
'NAME': url.path[1:],
'USER': url.username,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment