Merge lp:~daker/loco-team-portal/djdt-support into lp:loco-team-portal

Proposed by Adnane Belmadiaf on 2012-11-16
Status: Merged
Approved by: Michael Hall on 2012-11-16
Approved revision: 561
Merge reported by: Adnane Belmadiaf
Merged at revision: not available
Proposed branch: lp:~daker/loco-team-portal/djdt-support
Merge into: lp:loco-team-portal
Diff against target: 71 lines (+35/-1)
3 files modified
loco_directory/local_settings.py.sample (+3/-1)
loco_directory/settings.py (+31/-0)
requirements/dev.txt (+1/-0)
To merge this branch: bzr merge lp:~daker/loco-team-portal/djdt-support
Reviewer Review Type Date Requested Status
Chris Johnston Approve on 2012-11-16
Michael Hall (community) 2012-11-16 Approve on 2012-11-16
Review via email: mp+134741@code.launchpad.net

Commit Message

Add support for django debug toolbar to make debugging easier

To post a comment you must log in.
561. By Adnane Belmadiaf on 2012-11-16

* Fixes from mhall & chris

Michael Hall (mhall119) wrote :

Looks good to me

review: Approve
Chris Johnston (cjohnston) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/local_settings.py.sample'
2--- loco_directory/local_settings.py.sample 2010-07-30 16:14:42 +0000
3+++ loco_directory/local_settings.py.sample 2012-11-16 21:03:20 +0000
4@@ -3,6 +3,8 @@
5 #DATABASE_USER = ''
6 #DATABASE_PASSWORD = ''
7
8-SECRET_KEY = ''
9+SECRET_KEY = ''
10
11 DEBUG_USERS = ('')
12+
13+INTERNAL_IPS = ('127.0.0.1', '10.0.2.2')
14
15=== modified file 'loco_directory/settings.py'
16--- loco_directory/settings.py 2012-11-09 23:47:43 +0000
17+++ loco_directory/settings.py 2012-11-16 21:03:20 +0000
18@@ -45,6 +45,7 @@
19 DEBUG = True
20 TEMPLATE_DEBUG = DEBUG
21 STATIC_SERVE = True
22+USE_DEBUG_TOOLBAR = False
23
24 OPENID_STRICT_USERNAMES = True
25 OPENID_FOLLOW_RENAMES = True
26@@ -216,3 +217,33 @@
27 from local_settings import *
28 except ImportError:
29 logging.warning("No local_settings.py were found. See INSTALL for instructions.")
30+
31+
32+if DEBUG and USE_DEBUG_TOOLBAR:
33+ MIDDLEWARE_CLASSES += (
34+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
35+ )
36+
37+ INSTALLED_APPS += (
38+ 'debug_toolbar',
39+ )
40+
41+ DEBUG_TOOLBAR_PANELS = (
42+ 'debug_toolbar.panels.version.VersionDebugPanel',
43+ 'debug_toolbar.panels.timer.TimerDebugPanel',
44+ 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
45+ 'debug_toolbar.panels.headers.HeaderDebugPanel',
46+ 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
47+ 'debug_toolbar.panels.sql.SQLDebugPanel',
48+ 'debug_toolbar.panels.template.TemplateDebugPanel',
49+ 'debug_toolbar.panels.cache.CacheDebugPanel',
50+ 'debug_toolbar.panels.logger.LoggingPanel',
51+ )
52+
53+ DEBUG_TOOLBAR_CONFIG = {
54+ 'INTERCEPT_REDIRECTS': False,
55+ }
56+
57+ def show_toolbar(request):
58+ return True
59+ SHOW_TOOLBAR_CALLBACK = show_toolbar
60
61=== modified file 'requirements/dev.txt'
62--- requirements/dev.txt 2012-11-16 18:33:47 +0000
63+++ requirements/dev.txt 2012-11-16 21:03:20 +0000
64@@ -15,6 +15,7 @@
65 simplejson==2.0.9
66 feedparser
67 pylint==0.25.0
68+django-debug-toolbar==0.8.4
69
70 # Non-standard dependencies
71 -f http://launchpad.net/launchpadlib/trunk/1.6.0/+download/launchpadlib-1.6.0.tar.gz#egg=launchpadlib-1.6.0

Subscribers

People subscribed via source and target branches