1. Install Django-debug-toolbar.
2. Add 'debug _ toolbar. Middleware. debugtoolbarmiddleware 'to the middleware_classes in settings, which is generally the last line.
3. Add 'debug _ toolbar' to installed_apps in settings'
4. Add internal_ips = ('2017. 0.0.1 ',) to settings ',)
:
The items displayed in the Django toolbar can be modified by modifying the configuration file. Add the following code in settings. py:
Debug_toolbar_panels = (
'Debug _ toolbar. Panels. versions. versionspanel ',
'Debug _ toolbar. Panels. Timer. timerpanel ',
'Debug _ toolbar. Panels. settings. settingspanel ',
'Debug _ toolbar. Panels. headers. headerspanel ',
'Debug _ toolbar. Panels. Request. requestpanel ',
'Debug _ toolbar. Panels. SQL. sqlpanel ',
'Debug _ toolbar. Panels. staticfiles. staticfilespanel ',
'Debug _ toolbar. Panels. Templates. templatespanel ',
'Debug _ toolbar. Panels. cache. cachepanel ',
'Debug _ toolbar. Panels. signals. signalspanel ',
'Debug _ toolbar. Panels. Logging. loggingpanel ',
'Debug _ toolbar. Panels. redirects. redirectspanel ',
)
We can comment out what we don't want.