2013-05-15 46 views
0

我需要从视图通过在Django模板使用应答器来查看,所以我有一本字典包含我的论点 这个我在模板中使用的代码如何在django模板中的字典中获取参数?

{% for item in data % } 
{% for key, value in item.items %} 

{% if key == '13' %}<a href="{% url hisaccount value %}">{% endif %}<p>go to view</p></a> 

{% endfor %} 
{% endfor %} 

,但我得到这个错误:

NoReverseMatch at /filter/ 

Reverse for '' with arguments '(1,)' and keyword arguments '{}' not found. 

有什么建议吗?

+0

在'urls.py'如何定义'hisaccount'?如果是django 1.5,您可能需要执行''hisaccount'' – karthikr

+0

url(r'^ hisaccount /(?P [ - \ w] +)/ $','Our_MarketPlace.views.his_account',name =' hisaccount'), – imoum

+0

哪个版本的django? – karthikr

回答

相关问题