Permalink
Browse files

Use dj-database-url for database settings.

  • Loading branch information...
1 parent 97b3139 commit 66ea9aedd14506b35df0f4c3ab287ba196819acc @oremj oremj committed Dec 21, 2012
Showing with 12 additions and 15 deletions.
  1. +1 −0 requirements.txt
  2. +11 −15 sites/dev/settings.py
View
1 requirements.txt
@@ -1,6 +1,7 @@
#celery==2.5.1
#celery-tasktree==0.3.2
#django-celery==2.2.4
+dj-database-url==0.2.1
django-extensions==0.9
django-multidb-router==0.5
django-nose==1.1
View
26 sites/dev/settings.py
@@ -1,23 +1,19 @@
+import dj_database_url
+
import private
from gelato.admin.settings import *
-HOSTNAME='marketplace-admin-dev.allizom.org'
-DOMAIN=HOSTNAME
+HOSTNAME = 'marketplace-admin-dev.allizom.org'
+DOMAIN = HOSTNAME
SITE_URL = 'http://%s' % DOMAIN
STATIC_URL = SITE_URL
-DATABASES = {
- 'default': {
- 'ENGINE': 'mysql_pymysql',
- 'NAME': private.DATABASES_DEFAULT_NAME,
- 'HOST': private.DATABASES_DEFAULT_HOST,
- 'PORT': private.DATABASES_DEFAULT_PORT,
- 'USER': private.DATABASES_DEFAULT_USER,
- 'PASSWORD': private.DATABASES_DEFAULT_PASSWORD,
- 'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
- 'TEST_CHARSET': 'utf8',
- 'TEST_COLLATION': 'utf8_general_ci',
- },
-}
+DATABASES = {'default': dj_database_url.parse(private.DATABASES_DEFAULT_URL)}
+DATABASES.update({
+ 'ENGINE': 'mysql_pymysql',
+ 'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
+ 'TEST_CHARSET': 'utf8',
+ 'TEST_COLLATION': 'utf8_general_ci',
+})
SESSION_COOKIE_DOMAIN = ".%s" % HOSTNAME

0 comments on commit 66ea9ae

Please sign in to comment.