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