I’m having trouble implementing flatpages in Django 1.5.1 - I’m new to Django/Python (~3 months) so any insight is appreciated.
I’ve added flatpages in APPS and MIDDLEWARE_CLASSES and ran a syncdb:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'django.contrib.flatpages',
'blog',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)
I logged into Django admin and created:
URL: /about/
Title: About
Content: testing…
Sites: 127.0.0.1:8000
I clicked ‘view on site’ within the Django admin > flatpages > /about/ and I get sent to http://localhost:8000/about/ which returns a 404. I opened up a SQLite browser and I can see that my page is in the db. Am I missing anything else?
Thanks
James