为什么我看到apache的404而不是Django的自定义404?

在我的本地django runserver上,我创build了一个自定义templates/404.html ,这个工作没有问题。 但是在使用apache进行生产时,这个自定义的404.html不再显示(即使DEBUG=False )。

我只是得到一个白页

 Not Found The requested URL /blahblah was not found on this server. 

我不相信这不是Django默认,而是与Apache有关。

我如何告诉Apache让django处理404s?

你必须启用Django应用程序中的error404处理程序(请参阅https://stackoverflow.com/questions/17662928/django-creating-a-custom-500-404-error-page )以获取有关如何执行此操作的更多信息。

毕竟,我只是忘记了在生产服务器上设置模板所需的权限(我在后台程序模式下运行mod_wsgi为'djangoUser'),所以我需要

 dr-x------ djangoUser djangoUser templates dr------- djangoUser djangoUser templates/404.html 

D'哦。