Add debug warning to template

This commit is contained in:
rubenwardy 2019-11-14 23:38:11 +00:00
parent 2e14836ed6
commit 50892ce9fc
2 changed files with 10 additions and 0 deletions

View File

@ -135,6 +135,12 @@
<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>

View 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)