Hello, In part 3 of the Django Tutorial, "Write a 404 (page not found) view" it says-

"It finds it by looking for the variable handler404 in your root URLconf"

In my settings.py- ROOT_URLCONF='mysite.urls'

In mysite/urls.py, what syntax do I need to add? Where do I reference 'handler404'? The tutorial is not clear. I've set Debug=False and put a 404.html file in my templates root directory. But I get a Server Error (500) View returned.

asked 13 May '13, 14:08

marlowisws's gravatar image

accept rate: 0%

Well, it looks like it is because I am not generating a 404 error.., it is a 500 error but I can't understand the traceback when I go to

... File "C:\Users\Chris\mysite\polls\urls.py", line 7, in >module> from your application import views ImportError: No module named yourapplication ... "GET /polls/5/HTTP/1.1" 500 27

and my urls.py is-

from django.conf.urls import patterns, url
from polls import views

                     url(r'^$',views.index, name='index'),
                     url(r'^(?P<poll_id>\d+)/$', views.detail, name='detail'),
                     url(r'^(?P<poll_id>\d+)/results/$', views.results, name='results'),
                     url(r'^(?P<poll_id>\d+)/vote/$', views.vote, name='vote'),

answered 13 May '13, 14:25

marlowisws's gravatar image

accept rate: 0%

edited 14 May '13, 10:48

DjangoForum's gravatar image

DjangoForum ♦♦

which version of django are you following in tutorial and what is your django version


answered 13 May '13, 15:19

DjangoForum's gravatar image

DjangoForum ♦♦
accept rate: 8%

I'm using Django version 1.5.1 and following 1.5 tutorial- https://docs.djangoproject.com/en/1.5/ref/request-response/

(13 May '13, 15:47) marlowisws

copy and paste your error trace here please

(14 May '13, 10:50) DjangoForum ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 13 May '13, 14:08

Seen: 829 times

Last updated: 14 May '13, 10:50

powered by OSQA