Django + Flatpages = WTF?

OK, the title is a little misleading. I love the flatpages. I recently deployed them on this blog for the about and contact pages and they were working fine. This morning I noticed that they were raising a 404 (Page Not Found) error. That's where my "WTF" in the title comes in. Here is a check list to solve this flatpage issue.


  1. Add the middleware and app as directed on the flatpages documentation page.

  2. Make sure you have the correct SITE_ID in settings.py and make sure the flatpage is assigned to that site.

  3. Check that you have flatpages/default.html in one of your template paths.

  4. Verify that your default.html template is extending the correct base template

Number 4 was my problem. I have been working on the code to allow multiple template sets to be selected in the admin interface. In doing that, I re-factored the base layout to be in template/base/base.html but the default.html was still extending base_blog.html. Doh!

I wish there was something logged somewhere though that would let me know there was an error rendering the flatpage. The 404 was pretty cryptic.