TidharPeer
TidharPeer

Reputation: 3797

Django page not found - general

What is the difference between Django's two options:

?

Upvotes: 1

Views: 109

Answers (1)

Simeon Visser
Simeon Visser

Reputation: 122326

  • Returning HttpRequestNotFound means that the view takes care of presenting the 404 page and its HTML. You can use this if you want a view to present a different 404 error page than the default Django 404 page.
  • Raising Http404 means Django will use the default 404 view that you've configured (by default this is django.views.defaults.page_not_found). This can be modified by specifying a different handler for 404 pages (see django.conf.urls.handler404).

For more details see Django's documentation on 404 error pages.

Upvotes: 1

Related Questions