Skip to content

Commit

Permalink
changed settings.py to try strider db env variables, otherwise set fo…
Browse files Browse the repository at this point in the history
…r local
  • Loading branch information
sbronstein committed Apr 30, 2012
1 parent 80455ce commit b923247
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions klingsbo/settings.py
Expand Up @@ -30,18 +30,30 @@
#}



# example dev config with postgres
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'klingsbo', # Or path to database file if using sqlite3.
'USER': 'klingsbo', # Not used with sqlite3.
'PASSWORD': 'klingsbo', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
try:
#Strider db env variables
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'klingsbo', # Or path to database file if using sqlite3.
'USER': os.environ['POSTGRESQL_USERNAME'], # Not used with sqlite3.
'PASSWORD': os.environ['POSTGRESQL_PASSWORD'], # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': os.environ['POSTGRESQL_PORT'], # Set to empty string for default. Not used with sqlite3.
}
}
except:
# example dev config with postgres
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'klingsbo', # Or path to database file if using sqlite3.
'USER': 'klingsbo', # Not used with sqlite3.
'PASSWORD': 'klingsbo', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
Expand Down

0 comments on commit b923247

Please sign in to comment.