Setting up Django Debug Toolbar
install model
1
pip install django-debug-toolbar
Edit Setting.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# 1. ADD debug toolbar APP
'debug_toolbar',
....
....
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 2. Add Debug toolbar Middleware
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
....
....
# 3. Add internal IP
INTERNAL_IPS = ['127.0.0.1']Edit <project_folder/url.py>
1
2
3
4
5
6from django.conf import settings
....
if settings.DEBUG is True:
import debug_toolbar
urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]