gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-bank] branch master updated: fix db string in the de


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] branch master updated: fix db string in the default conf file
Date: Sat, 22 Apr 2017 15:03:10 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 5d52ca2  fix db string in the default conf file
5d52ca2 is described below

commit 5d52ca29b0659c62bf09891eed5071247ebaa76d
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Apr 22 15:03:05 2017 +0200

    fix db string in the default conf file
---
 bank.conf                  |  2 +-
 talerbank/settings_base.py | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/bank.conf b/bank.conf
index 67d4455..7693383 100644
--- a/bank.conf
+++ b/bank.conf
@@ -1,3 +1,3 @@
 [bank]
 uwsgi_serve = tcp
-database = postgres://talerbank
+database = postgres:///talerbank
diff --git a/talerbank/settings_base.py b/talerbank/settings_base.py
index 5eb2b57..df0e588 100644
--- a/talerbank/settings_base.py
+++ b/talerbank/settings_base.py
@@ -92,13 +92,14 @@ DATABASES = {}
 
 # parse a database URL, django can't natively do this!
 dbname = tc.value_string("bank", "database", required=False)
+logger.info("dbname: %s" % dbname)
 dbconfig = {}
 if dbname:
     db_url = urllib.parse.urlparse(dbname)
     if db_url.scheme != "postgres":
         raise Exception("only postgres db is supported ('{}' not 
understood)".format(dbname))
-    dbconfig['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
-    dbconfig['NAME'] = db_url.path.lstrip("/")
+    dbconfig["ENGINE"] = 'django.db.backends.postgresql_psycopg2'
+    dbconfig["NAME"] = db_url.path.lstrip("/")
 
     if not db_url.netloc:
         p = urllib.parse.parse_qs(db_url.query)
@@ -117,9 +118,10 @@ if dbname:
 
     DATABASES["default"] = dbconfig
 else:
+    logger.info("sqlite branch: %s" % os.path.join(BASE_DIR, "db.sqlite3"))
     DATABASES["default"] = {
-            'ENGINE': 'django.db.backends.sqlite3',
-            'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+            "ENGINE": "django.db.backends.sqlite3",
+            "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
     }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]