diff options
-rw-r--r-- | app.py | 6 | ||||
-rw-r--r-- | utils.py | 6 |
2 files changed, 7 insertions, 5 deletions
@@ -43,6 +43,12 @@ def read_blacklist(): with open(app.config['USERNAME_BLACKLIST_FILE']) as f: app.username_blacklist = f.read().split('\n') +@app.context_processor +def template_default_context(): + return { + 'app': app + } + @app.route('/', methods=['GET', 'POST']) @templated('index.html') @@ -28,11 +28,7 @@ def templated(template=None): if template_name is None: template_name = request.endpoint \ .replace('.', '/') + '.html' - - ctx = { - 'app': current_app, - } - ctx.update(f(*args, **kwargs)) + ctx = f(*args, **kwargs) if ctx is None: ctx = {} elif not isinstance(ctx, dict): |