Source

django-basic-events / events / urls.py

from django.conf.urls.defaults import *
from django.views.generic.date_based import archive_month

from events.models import Event
from events import views


urlpatterns = patterns('events.views',
    url(r'^(?P<category_slug>[\w-]+)/$',
            'list_events_for_category', 
            name='list_events_for_category'
        ),
    url(r'^$', 'list_events', name='list_events'),
    url(r'^(?P<year>\d{4})/(?P<month>\d+)/$', archive_month, {
            'date_field': 'begin_date',
            'queryset': Event.published.all(),
            'month_format': '%m',
            'template_name': 'events/archive/month.html',
        }, name='list_past_events'),
    url(r'^(?P<year>\d{4})/(?P<month>\d+)/(?P<event_slug>[\w-]+)/$',
        'view_event', name='view_event'),
)