Hi All,
I started with django and went through 2.5 tutorials relatively
painless, but nevertheless I stuck on tutorial #3. I tried to modify
regular expression, but error getting more complecated.
help needed fixed the urls.py (my guess)
thanks,
Vadim
Error message:
Request Method: GET
Request URL: http://localhost:8000/polls/index.html
Using the URLconf defined in mysite.urls, Django tried these URL
patterns, in this order:
^polls/$
^polls/(?P\d+)/$
^polls/(?P\d+)/results/$
^polls/(?P\d+)/vote/$
The current URL, polls/index.html, didn't match any of these.
== settings.py
(partial view)
ROOT_URLCONF = 'mysite.urls'
TEMPLATE_DIRS = (
"C:/Python2/Script/mysite/mytemplates"
)
=urls.py
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^polls/$', 'mysite.polls.views.index'),
(r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'),
(r'^polls/(?P\d+)/results/$',
'mysite.polls.views.results'),
(r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'),
)
views.py=
from django.template import Context, loader
from mysite.polls.models import Poll
from django.http import HttpResponse
def index(request):
latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
t = loader.get_template('polls/index.html')
c = Context({
'latest_poll_list': latest_poll_list,
})
return HttpResponse(t.render(c))
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---