tags:

views:

30

answers:

2

My flatpages relevant options in the settings.py look like this:

MIDDLEWARE_CLASSES = (
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'django.contrib.humanize',
    'registration',
)

and in the Backend I added a flatpage with the url set to "/" and one with "/about/. When I call these pages, django shows a 404 error. All my flatpages have a unique template. The "Template Name" entries are looking like this: /flatpages/about.html. What did i miss?

A: 

Do you have a base/default template in place for your flatpages, too? It's easy to miss as they docs don't go into much detail.

Easiest fix is to add /flatpages/default.html to your known templates, basing default.html on the example in the docs.

Or you can point your flatpages to a specific, existing template with the additional options in the admin edit page for a flatpage.

stevejalim
Sorry, I should have mentioned that. I point all my flatpages to a specific template. The "Template Name" entries are looking like this: /flatpages/about.html
Kai
A: 

I found it.

I forgot to set the SITE_ID in settings.py correctly.

Kai
Ah, gotcha. If it helps, feel free to download my take on a 'standard' Django project layout, which takes care of a lot of the setup bits that either take time or get forgotten: http://github.com/stevejalim/standards
stevejalim