#18880: [Documentation error] Raising error 404 section is wrong --------------------------------+------------------------------------ Reporter: devesh.gupta@… | Owner: nobody Type: Bug | Status: new Component: Documentation | Version: 1.3 Severity: Normal | Keywords: DoesNotExist exception Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------+------------------------------------ As per the code and text in written in tutorial 3, "Raising error 404": it is using "DoesNotExist" catch the exception.
This will not work, because exception which is raised when accessing a non-existing template is '''<class 'django.template.base.TemplateDoesNotExist'>''' Instead of DoesNotExist, it should be: def detail(request, poll_id): try: p = Poll.objects.get(pk=poll_id) return render_to_response('polls/detail.html', {'poll': p}) except TemplateDoesNotExist: raise Http404 -- Ticket URL: <https://code.djangoproject.com/ticket/18880> Django <https://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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.