- Install PyCallgraph with
pip install pycallgraph
- Copy and paste
callgraph_middleware.py
file somewhere in your django project - In your dev settings file add the middleware to the existing ones
- In settings add the
CALL_GRAPH_URLS
. This a list of dict, where each dict has 2 keys:
name
: this is the name of the url to debug (you have to use named url patterns)methods
: the request methods that will trigger the debug
The middleware will call PyCallGraph and print an svg (or png) graph only if:
- The urls have a
?graph
params