我有这个错误:NoReverseMatch at / Reverse for 'peliculas' 未找到。'peliculas' 不是有效的视图函数或模式名称。请求方法:GET 请求 URL:http : //127.0.0.1 :8000/ Django 版本:2.1.2 异常类型:NoReverseMatch 异常值:未找到“peliculas”的反向。'peliculas' 不是有效的视图函数或模式名称。异常位置:C:\Users\Angel\AppData\Local\Programs\Python\Python37\lib\site-packages\django\urls\resolvers.py in _reverse_with_prefix, line 622 Python Executable: C:\Users\Angel\AppData\ Local\Programs\Python\Python37\python.exe Python 版本:3.7.1 Python 路径:['C:\Users\Angel\Desktop\Trabajos\Videoclub\videoclub_django', 'C:\Users\Angel\AppData\Local\Programs\Python\Python37\python37.zip', 'C:\Users\Angel\AppData \Local\Programs\Python\Python37\DLLs'、'C:\Users\Angel\AppData\Local\Programs\Python\Python37\lib'、'C:\Users\Angel\AppData\Local\Programs\Python\Python37 ', 'C:\Users\Angel\AppData\Local\Programs\Python\Python37\lib\site-packages']我只是不明白发生了什么你可以在这里看到完整的代码:https://github.com/AngelQuesada/videoclub_django这是失败的部分(base_generic.html) <div class="collapse navbar-collapse" id="navbarNavDropdown"> <ul class="navbar-nav"> <li class="nav-item active"> <a class="nav-link" href="{% url 'index' %}">Inicio <span class="sr-only">(current)</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="{% url 'peliculas' %}">Peliculas</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Directores</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Actores</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Géneros</a> </li> <li class="nav-item"> <a class="nav-link" href="http://127.0.0.1:8000/admin/">Administración</a> </li> </ul> </div>
1 回答
SMILET
TA贡献1796条经验 获得超4个赞
您已在videoclubs
应用程序中为您的 URL 命名。所以而不仅仅是{% url 'peliculas' %}
你应该使用{% url 'videoclub:peliculas' %}
添加回答
举报
0/150
提交
取消