+from django.http import HttpResponse
+from django.shortcuts import render_to_response, get_object_or_404
+from django.template import RequestContext
+
+from taggit.models import Tag
+from .models import Recipe
+
+
+def tag(request, pk):
+ tag = get_object_or_404(Tag, pk=pk)
+ recipes = Recipe.objects.filter(tags__name__in=[tag.slug])
+ return render_to_response(
+ 'cookbook/recipes.html', {'recipes': recipes, 'title': tag.name},
+ RequestContext(request))