I am developing a blog with django,I want to redirect users to 404 page in case url patterns do not match. I know how to redirect to the 404 page when search queries to the database do not match i want to be able to do this when a url do not match any define in urlpatterns. How can i achieve this with django.
Asked
Active
Viewed 300 times
0
-
I think that django does this stuff without being programmed for that, doesn't it? – letsintegreat Jun 07 '18 at 15:47
-
Maybe this can interest you : https://stackoverflow.com/questions/30228818/redirect-any-urls-to-404-html-if-not-found-in-urls-py-in-django – Artory Jun 07 '18 at 15:53
1 Answers
0
You can make the changes to setting.py file of you project directory and debug=false then it will render default 404 page Note Use this in the production or you can use handler404

user9906996
- 13
- 3