#10987: [patch] generic object_detail  support for custom 404 page
------------------------------------+---------------------------------------
          Reporter:  redbaron       |         Owner:  nobody    
            Status:  new            |     Milestone:            
         Component:  Generic views  |       Version:  1.1-beta-1
        Resolution:                 |      Keywords:            
             Stage:  Unreviewed     |     Has_patch:  1         
        Needs_docs:  0              |   Needs_tests:  1         
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by dc):

  * needs_better_patch:  => 0
  * needs_tests:  => 1
  * needs_docs:  => 0

Comment:

 It can be done with
 {{{
 from django.views.default import page_not_found

 def my_view(request, *args, **kwargs):
     try:
         return object_detail(request, *args, **kwargs)
     except Http404:
         return page_not_found(request, template_name='my_404.html')
 }}}
 for e.g.

 Which is less implicit and more versatile way.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10987#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to