为什么这会返回一个NoReverseMatch
?
url(r'^write/(?:(?P<recipients>[\w.@+-:]+)/)?$', 'write', name='postman_write'),
模板:
<a href='{% url postman_write recipients=object.user %}'>Send Message</a>
这也不起作用..
<a href='{% url postman_write object.user %}'>Send Message</a>
返回:Reverse for 'postman_write' with arguments '(<User: admin>,)' and keyword arguments '{}' not found.
正确构建此 url 我缺少什么?谢谢!