From 4a863b529b9cbaf268e756c335981459a570a6e3 Mon Sep 17 00:00:00 2001 From: Ken Cochrane <kencochrane@gmail.com> Date: Sun, 27 Nov 2011 14:53:57 -0500 Subject: [PATCH] made it so that the compile doesn't fail if the DATABASES variable doesn't exist in settings.py --- bin/compile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 2509eac8..190b6454 100755 --- a/bin/compile +++ b/bin/compile @@ -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, -- GitLab