1 from django.conf import settings
2 from django.conf.urls.defaults import patterns, include, url
3 from django.views.generic import DetailView, ListView
8 # Uncomment the next two lines to enable the admin:
9 from django.contrib import admin
12 urlpatterns = patterns('',
13 url(r'^$', ListView.as_view(
14 queryset=models.Recipe.objects.all().order_by('name'),
15 context_object_name='recipes',
16 template_name='cookbook/recipes.html'),
18 url(r'^recipe/(?P<pk>\d+)/$', DetailView.as_view(
19 model=models.Recipe, template_name='cookbook/recipe.html'),
21 url(r'^tags/$', ListView.as_view(
22 queryset=taggit.models.Tag.objects.all(),
23 context_object_name='tags',
24 template_name='cookbook/tags.html'),
26 url(r'^tag/(?P<pk>\d+)/$', 'cookbook.views.tag', name='tag'),
28 # Uncomment the admin/doc line below to enable admin documentation:
29 # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
31 # Uncomment the next line to enable the admin:
32 url(r'^admin/', include(admin.site.urls), name='admin'),
34 url(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to',
35 kwargs={'url': settings.STATIC_URL + 'cookbook.ico'}),