我刚开始学习 python 和 django,我有一个问题。我得到了将功能视图转换为基于类的视图的任务。但是我的链接现在不起作用。
这些来自 urls.py:
url(r'^$', ContactIndex.as_view()),
url(r'^add$', ContactAdd.as_view()),
url(r'^([0-9]+)/update$', ContactUpdate.as_view()),
url(r'^([0-9]+)/view$', ContactView.as_view()),
这是我的链接:
{% url rtr_contact.views.ContactView contact.id %}
但这不起作用它说:
Caught NoReverseMatch while rendering: Reverse for 'rtr_contact.views.ContactView' with arguments '(20L,)' and keyword arguments '{}' not found.