Django raising 404 with a message
问题 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: handler404 = Custom404.as_view() Can anyone please tell me how should I be handling the error in my views. I'm fairly new to Django, so an example would help a lot. Many thanks in advance. 回答1: 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