Permalink
Browse files

Changed settings to support local devleopment environment

  • Loading branch information...
1 parent 662943b commit 6fa8512586da72b1829875e689764fecf77a1080 @edu222 committed Oct 7, 2012
Showing with 11 additions and 1 deletion.
  1. BIN .DS_Store
  2. +1 −0 .gitignore
  3. BIN udla_web_app/.DS_Store
  4. +10 −1 udla_web_app/settings.py
View
BIN .DS_Store
Binary file not shown.
View
@@ -1,2 +1,3 @@
venv
+*/local_settings.py
*.pyc
View
Binary file not shown.
View
@@ -1,6 +1,7 @@
# Django settings for udla_web_app project.
import dj_database_url
+
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -10,8 +11,16 @@
MANAGERS = ADMINS
+#Attempt to connect to the remote database from the local dev server.
+#If local_settings is not found then, assume working from deployed site.
+try:
+ from local_settings import DB_DICT
+except ImportError:
+ DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
+ pass
@petergx

petergx Oct 7, 2012

don't need pass

+else:
+ DATABASES = DB_DICT
-DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.

0 comments on commit 6fa8512

Please sign in to comment.