2👍
✅
You can manually run something like:
CsrfViewMiddleware.process_view(request, lambda: your_response, [], {})
P.S. I think it’s better to use handler404 to catch 404’s
Source:stackexchange.com