Thanks Karen.
On Apr 14, 11:33 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 3:03 AM, garazy <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I am going through the tutorial and have come to Decoupling the > > URLconfs @http://www.djangoproject.com/documentation/tutorial03/ > > > When I decouple the page athttp://192.168.0.101:8000/polls/just > > gives me a "It Worked!" welcome page. I've attached my urls.py configs > > > Thanks for your help, > > > Gary > > > mysite/urls.py > > =-=-=-=-=-=-=-= > > > from django.conf.urls.defaults import * > > > urlpatterns = patterns( > > (r'^polls/', include('mysite.polls.urls')), > > ) > > You are missing the first argument to patterns() here, which is the view > prefix. For your case it should be an empty string: > > urlpatterns = patterns('', > (r'^polls/', include('mysite.polls.urls')), > ) > > Karen > > > > > mysite/polls/urls.py > > =-=-=-=-=-=-=-=-=-= > > > from django.conf.urls.defaults import * > > > urlpatterns = patterns('mysite.polls.views', > > (r'^$', 'index'), > > (r'^(?P<poll_id>\d+)/$', 'detail'), > > (r'^(?P<poll_id>\d+)/results/$', 'results'), > > (r'^(?P<poll_id>\d+)/vote/$', 'vote'), > > ) > > > mysite/polls/views.py > > =-=-=-=-=-=-=-=-=-=-= > > > from django.shortcuts import render_to_response, get_object_or_404 > > from mysite.polls.models import Poll > > > 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}) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

