Merge pull request #10 from rackspace/better_wsgi

checks local_setting.py file before env vars
This commit is contained in:
Sandy Walsh 2012-11-07 08:02:02 -08:00
commit b50bab98d1

View File

@ -1,11 +1,20 @@
# Django settings for stproject project.
# Django settings for StackTach project.
import os
db_name = os.environ['STACKTACH_DB_NAME']
db_host = os.environ.get('STACKTACH_DB_HOST', "")
db_username = os.environ['STACKTACH_DB_USERNAME']
db_password = os.environ['STACKTACH_DB_PASSWORD']
install_dir = os.environ['STACKTACH_INSTALL_DIR']
try:
from local_settings import *
db_name = STACKTACH_DB_NAME
db_host = STACKTACH_DB_HOST
db_username = STACKTACH_DB_USERNAME
db_password = STACKTACH_DB_PASSWORD
install_dir = STACKTACH_INSTALL_DIR
except ImportError:
db_name = os.environ['STACKTACH_DB_NAME']
db_host = os.environ.get('STACKTACH_DB_HOST', "")
db_username = os.environ['STACKTACH_DB_USERNAME']
db_password = os.environ['STACKTACH_DB_PASSWORD']
install_dir = os.environ['STACKTACH_INSTALL_DIR']
DEBUG = False
TEMPLATE_DEBUG = DEBUG