Huge thanks Tanja - worked a treat.

Any ideas why the book has it the other way around?

2009/7/18 klaut <tanja.pis...@gmail.com>

>
>
>
> On Jul 18, 6:30 pm, "Rob B (uk)" <robtot...@googlemail.com> wrote:
> > Bit stumped on chapter 4.
> >
> > Every thing is working except I'm getting a 'Page not found (404)'
> > when I try to view any entries.
> >
> > View:
> > def entry_detail(request, year, month, day, slug):
> >         import datetime, time
> >         date_stamp = time.strptime(year+month+day, "%Y%b%d")
> >         pub_date = datetime.date(*date_stamp[:3])
> >         return render_to_response('coltrane/entry_detail.html',
> >                                   { 'entry': Entry.objects.get
> > (pub_date__year=pub_date.year,
> >
> > pub_date__month=pub_date.month,
> >
> > pub_date__day=pub_date.day,
> >
> > slug=slug) })
> >
> > Url:
> > (r'^weblog/(?P<year>\d{4})/(?P<month>\w{3})/(?P<day>\d{2})/(P?<slug>[-
> > \w]+)/$', 'coltrane.views.entry_detail'),
> >
> > Any ideas?
>
> Yes. You should switch the ... P?<slug> .. part to  ...?P<slug> ...
> The question mark should precede the character P.
>
> Hope it helps.
> Tanja
> >
>

--~--~---------~--~----~------------~-------~--~----~
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