[Django] Django Debug Toolbar debugging tool configuration, djangotoolbar
I am worried about how to debug Django.Django Debug ToolbarThis powerful tool.
First, let's talk about the problem:
There are also tutorials on the Internet, but there are a variety of things. I tried them one by one and did not run successfully. Finally, find the problem:
The development server log shows that the debug_toolbar has been loaded on the request page. But it is not displayed on the page:
From the browser's developer tools, we can see that jquery. min. js has timed out and has not been loaded successfully. This is the problem.
Add a line in settings. py:
1 DEBUG_TOOLBAR_CONFIG = { 'JQUERY_URL' : r"http://code.jquery.com/jquery-2.1.1.min.js"}
OK!
Complete installation tutorial (python3.4 + Django1.8)
Install Django Debug Toolbar
1. Install Django Debug Toolbar
1 pip install django-debug-toolbar
2. Copy the debug_toolbar to the project root directory, open the Project settings. py, and first make sure that
1 DEBUG = True
FindINSTALLED_APPS
, Add:
1 'debug_toolbar',
3. FindMIDDLEWARE_CLASSES
, Add:
1 'debug_toolbar.middleware.DebugToolbarMiddleware',
4. Add the setting item INTERNAL_IPS at the end of settings. py to set the IP address that allows access to the debug_toolbar.
1 INTERNAL_IPS = ('127.0.0.1',)
Complete