I'm getting 404 errors on day and detail views for date-based generic
views. In addition, the year archive doesn't show any entries, but the
month view does!

Here's my urlconf--is there something I'm missing? (I'm using Python
2.4.4, MySQL, & the dev server on localhost.)


from django.conf.urls.defaults import *
from datetime import datetime, date
from commonplace.family.models import ZoraPic


def latest_pics():
        return ZoraPic.public_objects.all()[:3]

def year_list():
        return ZoraPic.public_objects.dates('time', 'year').order_by('time')


zora_latest_dict = {
        'extra_context': {
                'latest_pics': latest_pics,
                'year_list': year_list
        }
}
zora_dict = {
        'queryset': ZoraPic.objects.all(),
        'date_field': 'time',
        'extra_context': {
                'year_list': year_list
        }
}


urlpatterns = patterns('django.views.generic',
        (r'^(?P<year>\d{4})/(?P<month>\d{2})/(P?<day>\d{2})/(?P<slug>[-\w]+)/
$', 'date_based.object_detail', dict(zora_dict, slug_field='slug',
month_format='%m', template_name='zora/detail.html')),
        (r'^(?P<year>\d{4})/(?P<month>\d{2})/(P?<day>\d{2})/$',
'date_based.archive_day', dict(zora_dict, month_format='%m',
template_name='zora/day.html')),
        (r'^(?P<year>\d{4})/(?P<month>\d{2})/$', 'date_based.archive_month',
dict(zora_dict, month_format='%m', template_name='zora/month.html')),
        (r'^(?P<year>\d{4})/$', 'date_based.archive_year', dict(zora_dict,
template_name='zora/year.html')),
        (r'^$', 'simple.direct_to_template', dict(zora_latest_dict,
template='zora.html')),
)


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

Reply via email to