django解决错误Reverse for 'show' with arguments '()' and keyword arguments '{}' not found. 办法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_19175749/article/details/80012956

保留个犯罪现场吧:

出现的错误

NoReverseMatch at /

Reverse for 'show' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['(\\d+)$']


经过分析,发现由于urls里面设置show参数的匹配正则是(\d+),在做反向解析的时候又没有参数传递过去,导致这个问题出现错误提示没有匹配到参数!故解决办法添加参数在 反向解析的时候,故问题解决

<a href="{%  url 'booktest:show' '456' %}">显示</a>



猜你喜欢

转载自blog.csdn.net/qq_19175749/article/details/80012956