[Django] Django Debug Toolbar debugging tool configuration, djangotoolbar

Source: Internet
Author: User
Tags install django pip install django

[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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.