安裝
$ pip install django-debug-toolbar
配置
Make sure that 'django.contrib.staticfiles' is set up properly and add 'debug_toolbar' to your INSTALLED_APPS
settings:
INSTALLED_APPS = [
# ...
'django.contrib.staticfiles',
# ...
'debug_toolbar',
]
STATIC_URL = '/static/'
For a simple Django project, that’s all you need!
The Debug Toolbar will automatically adjust a few settings when you start the development server, provided the DEBUG setting is True.