Python django url名称查找

Python django url名称查找,python,django,url-routing,Python,Django,Url Routing,我有三个url模式匹配到相同的url名称 url(r'^report/newreport/(?P<number>\w+)/$', 'report.views.newreport',name='report_newreport'), url(r'^report/newreport/(?P<number>\w+)/(?P<edit>\w+)/$', 'report.views.newreport',name='report_newreport'),

我有三个url模式匹配到相同的url名称

url(r'^report/newreport/(?P<number>\w+)/$', 'report.views.newreport',name='report_newreport'),  
url(r'^report/newreport/(?P<number>\w+)/(?P<edit>\w+)/$', 'report.views.newreport',name='report_newreport'),        
url(r'^report/newreport/$', 'report.views.newreport',name='report_newreport'),
这是因为我将三个url与一个url名称匹配吗?我认为应该通过将这三种模式匹配到三个不同的url名称来解决这个问题。这是我修复这个错误的另一种方法吗


谢谢

我认为问题在于,
report.applicationnumber
没有生成值:
带参数'('',)错误消息中的“
表示
report.applicationnumber
的值为空,在这种情况下,
url
标记尝试匹配url列表中不存在的url模式
^report/newreport/$

我认为问题在于,
report.applicationnumber
没有生成一个值:
带有参数'('',)错误消息中的“
表示
report.applicationnumber
的值为空,在这种情况下,
url
标记尝试匹配url列表中不存在的url模式
^report/newreport/$

为什么需要有多个同名视图?你试过给它们起不同的名字吗?另外,假设“ccicreport”和其他名字一样应该是“report”,你可以按照的例子将它们合并到一个正则表达式中。@perelman是的,它是一个拼写错误:),更新。为什么你需要有多个同名的视图?你试过给他们取不同的名字吗?另外,假设“ccicreport”和其他名字一样应该是“report”,你可以按照的例子将它们合并成一个正则表达式。@perelman是的,它是一个拼写错误:),更新了。
<td><a href='{% url report_newreport report.applicationnumber %} ' target='_blank' >{{task.applicationnumber}}</a> <br/>
Caught NoReverseMatch while rendering: Reverse for 'report_newreport' with arguments '('',)' and keyword arguments '{}' not found.