DJANGO: How can I use a browser (ie, ff) and a text editor (ultraedit, notepad ++) to debug Django programs?

Source: Internet
Author: User
Tags ultraedit

Django actually provides us with debugging information. Once an error occurs, a lot of information will be exposed when debug is set to true.

For example, the file, the row number, and the order in which these functions are called can all be seen.
HoweverCodeIt can also be folded and expanded, so it is very convenient.

In this case, I just inserted a simple line where the Code requires a breakpoint:

Debug ()

This function is a non-defined global function and cannot be found in Python and Django. Since this function does not exist, you can insert such a row when the code is correct, it is not surprising that no error is reported.
If you insert this function in front of your error location, you will block your error. Django reports in advance that debug () is not a global function error, click the local vars link to view the variable value in front of the debug () function.

For example:

If step = 1: S = form debug () return render_to_response ('equipment/done.html ', {'form _ data': [Form. cleaned_data for form in form_list],})

If the above Code says your code is in render_to_response (...) if an error occurs, insert a debug () line in front of it, and an error is reported in advance. Also, click Local vars, you can see the specific value of the variable s in the S = form line.

In general, you can use a browser and text editor and the method above to insert an invalid function that is intentionally interrupted to debug Django.ProgramWithout any other compilers.
Hope to give you some inspiration and help.

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.