gerrit.wikimedia.org
Gitiles
Code ReviewSign In
gerrit.wikimedia.org / operations / software / klaxon / 8f082bdb98472b313f33d1bd30e343a72da9c0a9^! / .
commit8f082bdb98472b313f33d1bd30e343a72da9c0a9[log] [tgz]
authorChris Danis <cdanis@wikimedia.org>Fri Jan 08 11:31:31 2021 -0500
committerChris Danis <cdanis@wikimedia.org>Fri Jan 08 11:56:13 2021 -0500
treea46617814ccb91524137e23fab104a9b71bbc788
parent07dd6e009fa732d13b9ec131399f530b2351c481 [diff]
add debug handlers Change-Id: Ibe9e6d27148244463a18347ca2423f7ee65da5a9
diff --git a/klaxon/__init__.py b/klaxon/__init__.py index d453c48..1b6c6ab 100644 --- a/klaxon/__init__.py +++ b/klaxon/__init__.py
@@ -120,4 +120,10 @@ 'but it was sent.') return redirect('/') + # Two flavors of the debug handler, so we can inspect both not-logged-in and logged-in state.+ @app.route('/_debug')+ @app.route('/protected/_debug')‚Äč+ def debug():+ return render_template('debug.html', vars=request.environ)+ return app
diff --git a/klaxon/templates/debug.html b/klaxon/templates/debug.html new file mode 100644 index 0000000..0b054b2 --- /dev/null +++ b/klaxon/templates/debug.html
@@ -0,0 +1,25 @@ +{% extends "base.html" %}++{% block content %}+<section class="section">+ <div class="container block has-text-centered">+ <h2 class="title is-4">Debug info</h2>+ </div>+ <div class="container block is-max-desktop">+ <table class="table is-striped">+ <tbody>+ {% for k, v in vars.items() %}+ <tr>+ <td>+ {{ k }}+ </td>+ <td>+ {{ v }}+ </td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+</section>+{% endblock %}
Powered by Gitiles
txt
json