Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 渲染时捕获到NoReverseMatch:Reverse for';selecao#u艺人';带参数';(u';';,)';和关键字参数';{}';找不到_Python_Django - Fatal编程技术网

Python 渲染时捕获到NoReverseMatch:Reverse for';selecao#u艺人';带参数';(u';';,)';和关键字参数';{}';找不到

Python 渲染时捕获到NoReverseMatch:Reverse for';selecao#u艺人';带参数';(u';';,)';和关键字参数';{}';找不到,python,django,Python,Django,由于某种原因,我似乎无法解决此错误。我正在使用Django 1.3.1 我得到的实际错误是: Caught NoReverseMatch while rendering: Reverse for 'selecao_artistas' with arguments '(u'',)' and keyword arguments '{}' not found. 我的模板: {% if produto.artista %} {% if produto.artista.nome_artistic

由于某种原因,我似乎无法解决此错误。我正在使用Django 1.3.1

我得到的实际错误是:

Caught NoReverseMatch while rendering: Reverse for 'selecao_artistas' with arguments '(u'',)' and keyword arguments '{}' not found.
我的模板:

{% if produto.artista %}
    {% if produto.artista.nome_artistico %}
        <h4><span>{% trans "Autor:"%} </span><a href="{% url selecao_artistas produto.artista.slug %}" >{{ produto.artista.nome_artistico }}</a></h4>
{% else %}
        <h4><span>{% trans "Autor:"%} </span><a href="{% url selecao_artistas produto.artista.slug %}" >{{ produto.artista }}</a></h4>
    {% endif %}
{% endif %}
{%if produto.artista%}
{%if produto.artista.nome_artistico%}
{%trans“Autor:%}
{%else%}
{%trans“Autor:%}
{%endif%}
{%endif%}

您可以注释出您的url标记,然后打印出{{produto.artista.slug}}并确保它存在于该上下文中吗。因为它看起来像是你传入了一个空参数,而你的url模式需要一些东西


注意:我会在评论中留下这一点,但我的代表不够高:(

你能发布你的URL.py吗?太长10855个字符,请使用selecao_Artista部分。事实上,这是错误的:
在呈现时捕捉到了NoReverseMatch:Reverse for'produtos_detalhes',未找到参数(“”,)和关键字参数“{}”。