]> git.lizzy.rs Git - cheatdb.git/commitdiff
Add debug warning to template
authorrubenwardy <rw@rubenwardy.com>
Thu, 14 Nov 2019 23:38:11 +0000 (23:38 +0000)
committerrubenwardy <rw@rubenwardy.com>
Thu, 14 Nov 2019 23:38:11 +0000 (23:38 +0000)
app/templates/base.html
app/views/__init__.py

index 05b12bc898b42032e6af8b0d32fc292b7d04a942..e39097c466e23931a82180bc817442a90c85dd78 100644 (file)
                <a href="{{ url_for('flatpage', path='policy_and_guidance') }}">{{ _("Policy and Guidance") }}</a> |
                <a href="{{ url_for('flatpage', path='help/reporting') }}">{{ _("Report / DMCA") }}</a> |
                <a href="{{ url_for('user_list_page') }}">{{ _("User List") }}</a>
+
+               {% if debug %}
+                       <p style="color: red">
+                               DEBUG MODE ENABLED
+                       </p>
+               {% endif %}
        </footer>
 
        <script src="/static/jquery.min.js"></script>
index c99ca03fe7d8072d6f52b70998dc4683e032ce21..3abb7ee8adb21ba18d79e00ae9c48756da86d9ca 100644 (file)
@@ -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)