Debug=False & !404.html = 500.html

I like the Django web framework.  No really, I do!   But I wish the maintainers handled getting out their strong beliefs a little bit better.

I rolled some code to a production web server.  The website itself was not yet in production (it was a beta version awaiting sign off by the customer), but I had turned off the debugging stuff in the settings.py file.

The problem that existed is in my settings.py file I had:

DEBUG = False

If you set this global variable (setting) off, and you do not have a 404.html or 500.html in one of your template paths, a server error (500) is thrown.  Great…try debugging that one, it wasn’t easy…honest.

Google found it with these keywords:  DEBUG flatpages

Which returned Ticket #3335 (Flatpages with DEBUG = False requires 404.html)

Good design practice to follow? Yes!

Better way to stress the message of why you should create your own 404 and 500? Absolutely!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s