Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7492779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:33:36+00:00 2026-05-29T16:33:36+00:00

I’m learning django with this excellent book Practical Django Projects. I was able to

  • 0

I’m learning django with this excellent book “Practical Django Projects”. I was able to follow the steps of the book perfectly, but now I stumbled upon the following problem.
When creating the page http://127.0.0.1:8000/first-page/ as image below:

enter image description here

I found the following error page:

enter image description here

Slightly different of this one, announced on book (page 16):

enter image description here

Then, I openned the file urls.py and added to it the following line of code:

(r'', include ('django.contrib.flatpages.urls')),

And the code looks like this:

enter image description here

I saved urls.py and accessed http://127.0.0.1:8000/first-page/ again, finding the same error message above (nothing changed), when, according to the book, I should now have found this other error page:

enter image description here

As a result, after I create the directory and file default.html for templates, as follows:

enter image description here

And have changed the TEMPLATE_DIRS settings.py file like this:

enter image description here

Again, the http://127.0.0.1:8000/first-page/ shows that same error message when, this time should show this:

enter image description here

I have repeated several times the steps.

I’m using Python 2.6 and django 1.1 (the same version of the book).

Does anyone have any idea about what I’m doing wrong?

Thank you in advance for any help.

It all seems so simple and straightforward. And yet, does not work!

Here my settings file code:

# Django settings for cms project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql',       'sqlite3' or 'oracle'.
DATABASE_NAME = 'C:\Projetos\cms\cms.db'             # Or path to database file if using sqlite3.
DATABASE_USER = ''             # Not used with sqlite3.
DATABASE_PASSWORD = ''         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with    sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

TIME_ZONE = 'America/Chicago'

LANGUAGE_CODE = 'en-us'

SITE_ID = 1

USE_I18N = True

MEDIA_ROOT = ''

MEDIA_URL = ''

ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = ''

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

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

ROOT_URLCONF = 'cms.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or      "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    'C:/Projetos/templates/',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',         
    'django.contrib.flatpages',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:33:42+00:00Added an answer on May 29, 2026 at 4:33 pm

    The answer to all errors was this (thanks, mongoose_za):

    “On page 15 [of the book “Practical Django Projects”] you must make sure you edit the example.com site instead of adding a new site. You might have noticed in your settings.py the SITE_ID = 1. If you add a new site 127.0.0.1:8000 then that will have a SITE_ID of 2, and in the following section flatpage views filter by default on the current site which is 1.”

    So, I just change SITE_ID = 2 (instead of 1) in settings.py, because I had added a new site 127.0.0.1:8000.

    After that, I changed the path to my templates folder according to instructions on the book to:

        TEMPLATE_DIRS = (
        # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
        # Always use forward slashes, even on Windows.
        # Don't forget to use absolute paths, not relative paths.
        'C:/Projetos/templates/',
    )
    

    I found the expected result (the blank page “My first page”)

    I also have followed this advice:

    “On p13 is where the first deviation from the older django kicks in. In your settings.py add ‘django.contrib.flatpages.middleware.FlatpageFallbackMiddleware’, (don’t forget the comma) to your MIDDLEWARE_CLASSES.”

    All this was found on this great blog:

    http://blog.haydon.id.au/2008/08/2-your-first-django-site-simple-cms.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.