I am getting an error creating a link in my Django template.
My template looks like this:
<a href="{% url 'location_detail' pk=location.id %}">{{ location.name }}</a>
My urls.py looks like:
url(r'^location(?P<pk>\d+)/$', views.location_detail, name="location_detail"),
My view looks like:
def location_detail(request, pk=None):
I get the error:
Reverse for views.location_detail with arguments '()' and keyword arguments '{u'pk': 1L}' not found.
I'm using Django 1.5 and python 2.7.2
Thanks!