Hi everyone, I'm struggling with an issue my girlfriend says is
"ironic". I can't get my custom 404 page to show. I've broken this
down to the simplest possible case. Here's what I did:
Create a new project called "experiment" in /home/me/experiment and
add a directory to that called templates. Here's the contents of /home/
me/experiment/experiment:
__init__.py
manage.py
settings.py
templates
urls.py
modify the following in settings.py:
DEBUG = False
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.
"/home/me/experiment/experiment/templates"
)
start up the testserver and go to
http://localhost:8000/osdijfosdijf
and get
"TemplateDoesNotExist: 500.html".
OK, makes sense. Now add 500.html to the ..../experiment/templates
directory. Contents are "500 page".
revisit:
http://localhost:8000/osdijfosdijf
again and see
"500 page"
Perfect. Now the weird part. Add a "404.html" to the same templates
directory and put this in it:
"404 page"
and again go to
http://fairware:8000/sdfdf
now firefox says:
"Cannot Complete Request
Additional information about this problem or error is currently
unavailable"
here's what gets spat out of the testserver when I submit the request:
[06/Sep/2009 17:55:20] "GET /sdfdf HTTP/1.1" 404 9
I feel like there isn't much to be missed here, but that I must have
missed it. If I create a file called "404.html" in my root template
directory, shouldn't I see the contents of that file when I get a 404?
Obviously django is finding the template.
I'm using django 1.1 with python 2.6 on ubuntu jaunty. I've (mis?)read
all of the django docs I can find on this. If anyone has incite,
please share.
Thank You
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---