Django 无法访问视图中的对象id

Django 无法访问视图中的对象id,django,Django,发送: url(r'^comment/(?P<slug>[\w-]+)/(?P<comment_pk>)\d+$', comment_delete, name='comment_delete') 即使我在模板中的链接中看到正确的id号,comment_pk的值也是空的 模板url标记 {% url 'comment_delete' group_profile.slug discussion.slug comment.pk %} 将\d+移动到?p内谢谢,哈哈,我回来发

发送:

url(r'^comment/(?P<slug>[\w-]+)/(?P<comment_pk>)\d+$', comment_delete, name='comment_delete')
即使我在模板中的链接中看到正确的id号,comment_pk的值也是空的

模板url标记

{% url 'comment_delete' group_profile.slug discussion.slug comment.pk %}

将\d+移动到?p内谢谢,哈哈,我回来发布我已经找到了它
{% url 'comment_delete' group_profile.slug discussion.slug comment.pk %}