Browse Source

deliver the debug templates only if DEBUG enabled and request IP is in INTERNAL_IPS setting

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
12c9423d54
  1. 3
      pyweb/settings.py
  2. 5
      pyweb/templates/index.html

3
pyweb/settings.py

@ -16,6 +16,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
""" """
################################################################# #################################################################
################################################################# #################################################################
## ## ## ##
@ -70,6 +71,8 @@ ADMINS = (
# Show debug information on errors? # Show debug information on errors?
# If you want to file a bug report, please enable this option. # If you want to file a bug report, please enable this option.
DEBUG = True DEBUG = True
# These IPs will be delivered the debug templates if DEBUG == True.
INTERNAL_IPS = ['127.0.0.1']
# Local time zone for this installation. Choices can be found here: # Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name

5
pyweb/templates/index.html

@ -11,8 +11,13 @@
<link rel="stylesheet" type="text/css" href="{{ MUMBLE_MEDIA_PREFIX }}css/style.css" /> <link rel="stylesheet" type="text/css" href="{{ MUMBLE_MEDIA_PREFIX }}css/style.css" />
<link rel="shortcut icon" type="image/png" href="{{ MUMBLE_MEDIA_PREFIX }}img/mumble.16x16.png" /> <link rel="shortcut icon" type="image/png" href="{{ MUMBLE_MEDIA_PREFIX }}img/mumble.16x16.png" />
{% if debug %}
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/adapter/ext/ext-base-debug.js"></script> <script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/ext-all-debug.js"></script> <script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/ext-all-debug.js"></script>
{% else %}
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}/ext-3.2.0/ext-all.js"></script>
{% endif %}
<script type="text/javascript" src="{{ MEDIA_URL }}/checkcolumn.js"></script> <script type="text/javascript" src="{{ MEDIA_URL }}/checkcolumn.js"></script>
{% block HeadTag %} {% block HeadTag %}

Loading…
Cancel
Save