[Django]-What may cause a Page Not Found error in flatpages?

7πŸ‘

βœ…

  1. Do you have FlatpageFallbackMiddleware in your list of MIDDLEWARE_CLASSES?

  2. Is there definitely a flatpage in your database with /about/ in the URL field?

  3. Is the flatpage linked to the correct Site object? It has to be linked to the Site object with a numeric ID matching the SITE_ID in your settings.py. The actual name/domain of the Site object are irrelevant in this case, it’s just the numeric ID you have to watch out for. In my experience this is the most common cause of mysteriously missing flatpages.

The request URL β€œhttp://example.com/about/” in your pasted 404 is confusing – I assume you put it there to hide your actual domain? Because if the actual request URL were at example.com, you wouldn’t get this Django debug page.

πŸ‘€Carl Meyer

Leave a comment