mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Do env variable handling outside of template.
This commit is contained in:
+2
-2
@@ -92,8 +92,8 @@ def set_cors_headers(response):
|
||||
@app.route('/')
|
||||
def view_landing_page():
|
||||
"""Generates Landing Page."""
|
||||
|
||||
return render_template('index.html', env=os.environ)
|
||||
tracking_enabled = 'HTTPBIN_TRACKING' in os.environ
|
||||
return render_template('index.html', tracking_enabled=tracking_enabled)
|
||||
|
||||
|
||||
@app.route('/html')
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
{% include 'httpbin.1.html' %}
|
||||
|
||||
{% if env.get('HTTPBIN_TRACKING', '0') == '1' %}
|
||||
{% if tracking_enabled %}
|
||||
{% include 'trackingscripts.html' %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user