Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created April 6, 2012 08:49
Show Gist options
  • Select an option

  • Save AeroNotix/2318259 to your computer and use it in GitHub Desktop.

Select an option

Save AeroNotix/2318259 to your computer and use it in GitHub Desktop.
from django.conf.urls import patterns, include, url
from django.contrib import admin
from timetracker import views
admin.autodiscover()
year = '(?P<year>\d{4})'
month = '(?P<month>\d{1,2})'
day = '(?P<day>\d{1,2})'
urlpatterns = patterns('',
url(r'^$', 'timetracker.views.index'),
url(r'^calendar$', views.view_calendar),
url(r'^calendar/$', views.view_calendar),
url(r'^calendar/%s/?$' % year, views.view_calendar),
url(r'^calendar/%s/%s/?$' % (year, month), views.view_calendar),
url(r'^calendar/%s/%s/%s/?$' % (year, month, day), views.view_calendar),
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment