1👍
You can print some value just like this:
def some_context_processor(request):
return {'system_name': 'test'}
and in your html:
{{ system_name }}
1👍
The django debug toolbar is useful for this. Its template panel shows you all the templates rendered, and the values returned by all the context processors.
0👍
For debugging in python in general, just add import pdb
to the top of the script which you wish to debug and use pdb.set_trace()
in whichever line you wish to insert a breakpoint.
Run the server and as the control reaches the line containing pdb.set_trace()
take a look at your development server prompt, you can access all local vars to check what vars hold what value.
- [Answered ]-Shared memory in web application
- [Answered ]-How to design a Web application in django for mobile devices (phones / tablets)
- [Answered ]-Django – Need to access the current template name in middleware
Source:stackexchange.com