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.

Technorati Tags: , , , ,

Want to know what I'm doing right now? Follow me on Twitter! If you like this post then please consider subscribing to my full RSS feed.

Trackbacks/Pings (Trackback URL)

Comments are disabled for this post.

Subscribe


Subscribe to Full RSS Feed

Name:
Email:
Hey, I hate spam as much as you! I will never share your info with anyone!

WTF?

Peter Chillin'

Hey there. My name is Peter. I am a father, a husband, a geek, a horrible poker player and a bit of a degenerate. And I'm OK with that. More...

pjs[at]petersanchez[dot]com

flickr - twitter - del.icio.us - PGP

Search

 

The Latest

Topics

BlogRush