浏览代码

Enable debug toolbar on sandbox build

master
David Winterbottom 13 年前
父节点
当前提交
f5066af96c
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      sites/sandbox/settings.py

+ 7
- 0
sites/sandbox/settings.py 查看文件

@@ -249,8 +249,15 @@ HAYSTACK_CONNECTIONS = {
249 249
     },
250 250
 }
251 251
 
252
+# Allow internal IPs to see the debug toolbar.  This is just for Tangent's QA
253
+# department to be able to create better issues when something goes wrong.
254
+def is_internal(request):
255
+    ip_addr = request.META['REMOTE_ADDR']
256
+    return ip_addr in INTERNAL_IPS or ip_addr.startswith('192.168')
257
+
252 258
 DEBUG_TOOLBAR_CONFIG = {
253 259
     'INTERCEPT_REDIRECTS': False,
260
+    'SHOW_TOOLBAR_CALLBACK': is_internal
254 261
 }
255 262
 
256 263
 AUTH_PROFILE_MODULE = 'user.Profile'

正在加载...
取消
保存