aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--development.ini3
-rw-r--r--fietsboek/__init__.py8
-rw-r--r--production.ini3
3 files changed, 7 insertions, 7 deletions
diff --git a/development.ini b/development.ini
index 15250c4..47e0231 100644
--- a/development.ini
+++ b/development.ini
@@ -16,9 +16,6 @@ pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =
pyramid_debugtoolbar
-jinja2.filters =
- format_decimal = fietsboek.jinja2.filter_format_decimal
- format_datetime = fietsboek.jinja2.filter_format_datetime
sqlalchemy.url = sqlite:///%(here)s/fietsboek.sqlite
diff --git a/fietsboek/__init__.py b/fietsboek/__init__.py
index 98e6846..6ed9028 100644
--- a/fietsboek/__init__.py
+++ b/fietsboek/__init__.py
@@ -8,6 +8,7 @@ from pyramid.settings import asbool, aslist
from pyramid.i18n import default_locale_negotiator
from .security import SecurityPolicy
+from . import jinja2 as fiets_jinja2
def locale_negotiator(request):
@@ -41,7 +42,7 @@ def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
# pylint: disable=unused-argument
- if 'session_key' not in settings:
+ if settings.get('session_key', '<EDIT THIS>') == '<EDIT THIS>':
raise ValueError("Please set a session signing key (session_key) in your settings!")
settings['enable_account_registration'] = asbool(
@@ -59,4 +60,9 @@ def main(global_config, **settings):
config.set_session_factory(my_session_factory)
config.set_security_policy(SecurityPolicy())
config.set_locale_negotiator(locale_negotiator)
+
+ jinja2_env = config.get_jinja2_environment()
+ jinja2_env.filters['format_decimal'] = fiets_jinja2.filter_format_decimal
+ jinja2_env.filters['format_datetime'] = fiets_jinja2.filter_format_datetime
+
return config.make_wsgi_app()
diff --git a/production.ini b/production.ini
index 9dd45c2..2a822d5 100644
--- a/production.ini
+++ b/production.ini
@@ -11,9 +11,6 @@ pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
-jinja2.filters =
- format_decimal = fietsboek.jinja2.filter_format_decimal
- format_datetime = fietsboek.jinja2.filter_format_datetime
email.from = fietsboek@kingdread.de
email.smtp_url = debug://localhost:1025