summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bank.conf1
-rw-r--r--talerbank/settings.py17
2 files changed, 16 insertions, 2 deletions
diff --git a/bank.conf b/bank.conf
index 6b33eb3..7c9a772 100644
--- a/bank.conf
+++ b/bank.conf
@@ -1,3 +1,4 @@
[bank]
uwsgi_port = 8001
database = talerbank
+currency = PUDOS
diff --git a/talerbank/settings.py b/talerbank/settings.py
index b637acf..49bdc53 100644
--- a/talerbank/settings.py
+++ b/talerbank/settings.py
@@ -9,11 +9,16 @@ https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
+from .talerconfig import TalerConfig
+from django.core.exceptions import ImproperlyConfigured
+import logging
+
+logger = logging.getLogger(__name__)
+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
@@ -126,6 +131,14 @@ STATICFILES_DIRS = [
STATIC_ROOT = 'static/'
+tc = TalerConfig()
+
+curr = tc.get_string("bank", "currency")
+if not curr:
+ logger.warn("currency not configured in taler config, falling back to PUDOS")
+ TALER_CURRENCY = "PUDOS"
+else:
+ TALER_CURRENCY = curr
+
TALER_PREDEFINED_ACCOUNTS = ['Tor', 'GNUnet', 'Taler', 'FSF']
TALER_EXPECTS_DONATIONS = ['Tor', 'GNUnet', 'Taler', 'FSF']
-TALER_CURRENCY = "PUDOS"