@CodenameTim once pointed out that you can use pdb to debug Django. That sounds great, but I’ve never had reason to use it until today.
Today the thing I’m trying to debug is a call to
render(). Its output is of type
HTTPResponse, and its first input is an HTTP request (neither pydoc nor the online docs specify the exact type name). I can start a
python3 manage.py shell and import the library defining my buggy call to
render(), but I don’t know how to provide the request argument, and even if I did, I wouldn’t know how to view the output response.
(In my present case, viewing the response is unnecessary – I hit a bug before I get there – but I imagine it’s useful in general.)