How to properly setup custom handler404 in django?
问题 According to the documentation this should be fairly simple: I just need to define handler404 . Currently I am doing, in my top urls.py : urlpatterns = [ ... ] handler404 = 'myapp.views.handle_page_not_found' The application is installed. The corresponding view is just (for the time being I just want to redirect to the homepage in case of 404): def handle_page_not_found(request): return redirect('homepage') But this has no effect: the standard (debug) 404 page is shown. The documentation is a