I am creating a 404.html page in django which will be called when i raise “Http404”
I dont know if 404.html will be passed a “RequestContext” object but can I generate the requested url path without using request variable
I tried “request.path” and “request.get_full_path” but they dont work for me.
Any help would be appreciated.
The 404 template will be rendered with a request context (unlike the 500 server error template).
Make sure that the
django.core.context_processors.requestcontext processor is in yourTEMPLATE_CONTEXT_PROCESSORSsetting. Note that it is not included by default.Once you’ve done that, the request methods that you mention like
get_full_pathshould work.