Go – How to trace import of the views in Django


Is there a way to somehow trace importing of the views ? I want to find which one is broken and doesn't import in some situations (which leads to the fact that all url resolving schema in django stops working).

Best Solution

Pretty amazing that no one has suggested pdb. Place the following in a strategic point in your code:

import pdb;pdb.set_trace()

When execution reaches that point, the dev server will drop into a shell where you can check values of variables, trace the execution, etc.

It works like a standard shell (use any python commands you like), but there's also special commands that let you control the execution. For example next will go to the next line (processing the previous line). continue will continue execution until the next break point, etc. (full list of pdb commands)