Flatpages - Django 1.5.1

33 views
Skip to first unread message

James

unread,
Jan 20, 2014, 7:41:05 PM1/20/14
to django...@googlegroups.com

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

James

unread,
Jan 21, 2014, 11:00:15 AM1/21/14
to django...@googlegroups.com
Fixed. After some Google-fu I set SITE_ID = 2 and it worked.
Reply all
Reply to author
Forward
0 new messages