python - Receiving error: Reverse for with arguments '()' and keyword arguments not found -
i getting error creating link in django template.
my template looks 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 error:
reverse views.location_detail arguments '()' , keyword arguments '{u'pk': 1l}' not found.
i'm using django 1.5 , python 2.7.2
thanks!
the problem had name space on primary project urls.py:
url(r'^com/', include('com.urls', namespace="com")),
changing url to:
{% url 'com:location_detail' pk=location.id %}
that did trick
Comments
Post a Comment