I like to raise 404 with some error message at different places in the script eg: Http404(\"some error msg: %s\" %msg) So, in my urls.py I included:
Http404(\"some error msg: %s\" %msg)
<
In general, 404 error is "page not found" error - it should not have customizable messages, simply because it should be raised only when a page is not found.
You can return a TemplateResponse with status parameter set to 404
404