typeidea icon indicating copy to clipboard operation
typeidea copied to clipboard

第154页代码勘误:《Django企业开发实战》2020年3月河北第6次印刷

Open MaoningGuan opened this issue 5 years ago • 0 comments

问题阐述:

当访问首页时,标签的标题没有显示为:首页 - typeidea 博客系统

问题解决:

1、修改base.html的代码:

<title>{% block title %}首页{% endblock %}- typeidea 博客系统</title>

修改为:

<title>{% block title %}{% endblock %}- typeidea 博客系统</title>

2、修改list.html代码:

{% block title %}
    {% if tag %}
    标签页:{{ tag.name }}
    {% elif  category %}
    分类页:{{ category.name }}
    {% endif %}
{% endblock %}

修改为:

{% block title %}
    {% if tag %}
    标签页:{{ tag.name }}
    {% elif  category %}
    分类页:{{ category.name }}
    {% else %}
    首页
    {% endif %}
{% endblock %}

MaoningGuan avatar Jun 14 '20 13:06 MaoningGuan