I've very strange error in part 3. I want to test using function
get_object_or_404. I've 3 polls, so in that adress:
http://localhost:8000/polls/1/
http://localhost:8000/polls/2/
http://localhost:8000/polls/3/
everything is OK.
In that adress:
http://localhost:8000/polls/4/
Should be exeptions 404. I have made my own template 404.html. In
firefox is OK - it's works but in IE and Chrome is error like: Oops!
This link appears to be broken.
Could you tell me why the other clients don't use my template?

views.py:
from mysite.polls.models import Poll
from django.http import HttpResponse
from django.shortcuts import render_to_response, get_object_or_404

def index(request):
        latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
        return render_to_response('polls/index.html', {'latest_poll_list':
latest_poll_list})

def detail(request, poll_id):
        p = get_object_or_404(Poll, pk=poll_id)
        return render_to_response('polls/detail.html', {'poll': p})

def results(request):
        return HttpResponse('results')

def vote(request):
        return HttpResponse('vote')

urls.py:
from django.conf.urls.defaults import *
from mysite.polls.models import Poll

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
        (r'^polls/$', 'mysite.polls.views.index'),
        (r'^polls/(?P<poll_id>\d+)/$', 'mysite.polls.views.detail'),
        (r'^polls/(?P<poll_id>\d+)/results/$', 'mysite.polls.views.results'),
        (r'^polls/(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
        (r'^admin/(.*)', admin.site.root),
)

404.html:
Error 404

404.html is in C:\django\mysite\my_templates

Before this everything in this tutorial works.

Can you help me?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to