From 50892ce9fc6a44475b447b90909f83c2148f8096 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 14 Nov 2019 23:38:11 +0000 Subject: [PATCH] Add debug warning to template --- app/templates/base.html | 6 ++++++ app/views/__init__.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/app/templates/base.html b/app/templates/base.html index 05b12bc..e39097c 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -135,6 +135,12 @@ {{ _("Policy and Guidance") }} | {{ _("Report / DMCA") }} | {{ _("User List") }} + + {% if debug %} +

+ DEBUG MODE ENABLED +

+ {% endif %} diff --git a/app/views/__init__.py b/app/views/__init__.py index c99ca03..3abb7ee 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -25,6 +25,10 @@ from urllib.parse import urlparse from sqlalchemy.sql.expression import func cache = SimpleCache() +@app.context_processor +def inject_debug(): + return dict(debug=app.debug) + @app.template_filter() def throw(err): raise Exception(err)