Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use dj-database-url for database settings.

  • Loading branch information...
commit 66ea9aedd14506b35df0f4c3ab287ba196819acc 1 parent 97b3139
Jeremy Orem authored
1  requirements.txt
... ...
@@ -1,6 +1,7 @@
1 1
 #celery==2.5.1
2 2
 #celery-tasktree==0.3.2
3 3
 #django-celery==2.2.4
  4
+dj-database-url==0.2.1
4 5
 django-extensions==0.9
5 6
 django-multidb-router==0.5
6 7
 django-nose==1.1
26  sites/dev/settings.py
... ...
@@ -1,23 +1,19 @@
  1
+import dj_database_url
  2
+
1 3
 import private
2 4
 from gelato.admin.settings import *
3 5
 
4  
-HOSTNAME='marketplace-admin-dev.allizom.org'
5  
-DOMAIN=HOSTNAME
  6
+HOSTNAME = 'marketplace-admin-dev.allizom.org'
  7
+DOMAIN = HOSTNAME
6 8
 SITE_URL = 'http://%s' % DOMAIN
7 9
 STATIC_URL = SITE_URL
8 10
 
9  
-DATABASES = {
10  
-    'default': {
11  
-        'ENGINE': 'mysql_pymysql',
12  
-        'NAME': private.DATABASES_DEFAULT_NAME,
13  
-        'HOST': private.DATABASES_DEFAULT_HOST,
14  
-        'PORT': private.DATABASES_DEFAULT_PORT,
15  
-        'USER': private.DATABASES_DEFAULT_USER,
16  
-        'PASSWORD': private.DATABASES_DEFAULT_PASSWORD,
17  
-        'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
18  
-        'TEST_CHARSET': 'utf8',
19  
-        'TEST_COLLATION': 'utf8_general_ci',
20  
-    },
21  
-}
  11
+DATABASES = {'default': dj_database_url.parse(private.DATABASES_DEFAULT_URL)}
  12
+DATABASES.update({
  13
+    'ENGINE': 'mysql_pymysql',
  14
+    'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
  15
+    'TEST_CHARSET': 'utf8',
  16
+    'TEST_COLLATION': 'utf8_general_ci',
  17
+})
22 18
 
23 19
 SESSION_COOKIE_DOMAIN = ".%s" % HOSTNAME

0 notes on commit 66ea9ae

Please sign in to comment.
Something went wrong with that request. Please try again.