Aljosa Mohorovic wrote:
> if i call raise Http404("my message") and i set custom view to handle
> 404 errors how do i get "my message" in that view?

I was gonna say look at the default 404 template.  But, in my django 
(newforms admin branch) /django/contrib/admin/templates/admin/404.html 
there is no template var used :(

Checking docs 
http://www.djangoproject.com/documentation/request_response/#the-http404-exception
 
I find no answer :(


Digging through the code I eventually found
     c = Context({
         'root_urlconf': settings.ROOT_URLCONF,
         'request_path': request.path[1:], # Trim leading slash
         'urlpatterns': tried,
         'reason': str(exception),
         'request': request,
         'request_protocol': request.is_secure() and "https" or "http",
         'settings': get_safe_settings(),
     })

So, it looks like "reason" is the template var you want.


-- 
Norman J. Harman Jr.
Senior Web Specialist, Austin American-Statesman
___________________________________________________________________________
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to