For the sake of completeness and in case someone with less regex-fu
that Karen, here is the correct urlpatterns:

urlpatterns = patterns('',
                       url(r'^$',
                           date_based.archive_index,
                           entry_info_dict,
                           name='entry_archive_index'),
                       url(r'^(?P<year>\d{4})/$',
                           date_based.archive_year,
                           dict(entry_info_dict,
make_object_list=True, template_object_name='entry'),
                           name='entry_archive_year'),
                       url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
                           date_based.archive_month,
                           dict(entry_info_dict, month_format='%m'),
                           name='entry_archive_month'),
                       url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?
P<day>\d{1,2})/$',
                           date_based.archive_day,
                           dict(entry_info_dict, month_format='%m'),
                           name='entry_archive_day'),
                       url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?
P<day>\d{1,2})/(?P<slug>[-\w]+)/$',
                           date_based.object_detail,
                           dict(entry_info_dict, slug_field='slug',
month_format='%m'),
                           name='entry_detail'),
                       )

On Aug 28, 3:23 pm, Fil <p.maric...@gmail.com> wrote:
> I knew it was stupid !
>
> Working now, of course.
>
> Thx a lot Karen.
>
> On Aug 28, 2:44 pm, Karen Tracey <kmtra...@gmail.com> wrote:
>
>
>
> > On Fri, Aug 28, 2009 at 4:34 AM, Phil <p.maric...@gmail.com> wrote:
>
> > > Guys,
>
> > > I have this error in my template when rendering my view: "Caught an
> > > exception while rendering: Reverse for 'entry_archive_month' with
> > > arguments '()' and keyword arguments '{'month': 8, 'year': 2009}' not
> > > found."
>
> > Your urlpattern for entry_archive_month is:
>
> > url(r'^(?P<year>\d{4})/(?P<month>\d{2})/ ,
> >     date_based.archive_month,
> >     dict(entry_info_dict, month_format='%m'),
> >     name='entry_archive_month'),
>
> > That (since you specified {2} after the \d where you capture the month)
> > requires exactly 2 digits in the month.  Per the error message you only have
> > one digit in the month, so no reverse can be found for the kwargs you have
> > specified.
>
> > Karen
>
> > > I've starred at my code for too long and I can't see where the problem
> > > lies. I'm sure it's a stupid and silly error, but I've look too much
> > > at my code and can't seem to figure out what is happening.
>
> > > Basically, the tag {% url blog:entry_archive_month
> > > year=date.year,month=date.month %} is throwing the 'reverse for
> > > 'entry_archive_month not found'.
> > > I've tried with args instead of kwargs (i.e.: {% url
> > > blog:entry_archive_monthdate.year,date.month %} but without success
>
> > > In another template, I have {% url blog:entry_archive_year
> > > year=year.year %} and it works perfectly fine (and even the 'args'
> > > version, which seems to indicate that this is some serious flaw in my
> > > understanding of url namespace and reversing in django).
>
> > > I'm just baffled and to tired to see clearly what is my stupipd
> > > mistake.
>
> > > Here is the traceback:http://dpaste.com/86470/
>
> > > Here is some part of my code (the two urls.py):
> > >http://dpaste.com/hold/86487/
>
> > > Can anyone help me with this one ?
--~--~---------~--~----~------------~-------~--~----~
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