Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.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
为什么我不';使用django无法查看html中的所有部分_Html_Django_Django Templates - Fatal编程技术网

为什么我不';使用django无法查看html中的所有部分

为什么我不';使用django无法查看html中的所有部分,html,django,django-templates,Html,Django,Django Templates,我编写了以下代码: {% extends "base.html" %} {% block content %} {% if all_site %} <ul> <h3>Here all my site:</h3> {% for site in all_site %} <li><a href="/site/{{ site.id }}/"> {{ site.na

我编写了以下代码:

{% extends "base.html" %}
{% block content %}
{% if all_site %}
    <ul>
    <h3>Here all my site:</h3>
    {% for site in all_site  %}
        <li><a href="/site/{{ site.id }}/"> {{ site.name }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <h3> You don't have any Site.</h3>
{% endif %}
{% endblock content %}
{%extends“base.html”%}
{%block content%}
{%if所有_站点%}
    以下是我的所有网站: {所有站点中站点的%u%}
  • {%endfor%}
{%else%} 你没有任何网站。 {%endif%} {%endblock内容%}

什么时候,我跑。我没有看到“我的所有站点”,但我只看到了for中包含的一个。

我试图修改它,目前我发现一个有效的解决方案是:

{% extends "base.html" %}
{% block content %}
{% if all_site %}
    <h3>mmmmmm</h3>
    <ul>
    <h3>Here all my site:</h3>
    {% for site in all_site  %}
        <li><a href="/site/{{ site.id }}/"> {{ site.name }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <h3> You don't have any Site.</h3>
{% endif %}
{% endblock content %}

我试图对其进行修改,目前我发现一个可行的解决方案是:

{% extends "base.html" %}
{% block content %}
{% if all_site %}
    <h3>mmmmmm</h3>
    <ul>
    <h3>Here all my site:</h3>
    {% for site in all_site  %}
        <li><a href="/site/{{ site.id }}/"> {{ site.name }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <h3> You don't have any Site.</h3>
{% endif %}
{% endblock content %}
尝试将
移动到
之外,
    的唯一有效子级。大多数浏览器仍然应该呈现它,尽管将
    移动到
    之外,
    的唯一有效子级。但是大多数浏览器仍然应该呈现它