2

On my local django runserver I created a custom templates/404.html, and this works no problem. However in production with apache this custom 404.html is no longer shown (even with DEBUG=False).

I just get a white page with

Not Found

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

I don't believe that this isn't even the django default, but rather something to do with apache.

How do I tell apache to let django handle the 404s?

fpghost
  • 663
  • 1
  • 10
  • 22

2 Answers2

1

After all that I simply had forgotten to set the needed permissions for the template on the production server(I'm running mod_wsgi in daemon mode as 'djangoUser'), so I needed

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

d'oh.

fpghost
  • 663
  • 1
  • 10
  • 22
0

You have to enable the error404 handler in your Django app (see https://stackoverflow.com/questions/17662928/django-creating-a-custom-500-404-error-page) for more information on how to do this.

deagh
  • 1,969
  • 5
  • 18
  • 16
  • 1
    I don't think that is the issue, the default 404 handler fits my needs, and django knows where to find my custom "404.html" template in my project (as shown in the local runserver). – fpghost Aug 13 '14 at 14:50