python - 我对 django-mptt 有问题。我是第一次使用 django-mptt,但出现以下错误
问题描述
我第一次使用 django-mptt,我有以下错误。
VariableDoesNotExist at /about
Failed lookup for key [category] in [{'True': True, 'False': False, 'None': None}, {}, {},
{'setting': <Setting: Techno Store>}]
这是我尝试从一个索引页移动到另一个索引页时发生的错误
我的代码在这里:
<nav class="category-menu category-style-2">
{% load mptt_tags %}
<ul>
{% recursetree category %}
<li {% if not node.is_leaf_node %}class="menu-item-has-children"{% endif %}><a href="{% url 'category_products' node.id node.slug %}">{{ node.title }}</a>
<!-- Mega Category Menu Start -->
{% if not node.is_leaf_node %}
<ul class="category-mega-menu">
<li class="menu-item-has-children">
<ul>
<li><a href="#">{{ children }}</a></li>
</ul>
</li>
</ul><!-- Mega Category Menu End -->
{% endif %}
</li>
{% endrecursetree %}
</ul>
</nav>
解决方案
推荐阅读
- angular - 如何在打字稿中过滤对象数组
- sql - 如何估计插入到 SQL Server 表中的单行的理论大小
- powershell - Powershell 脚本循环不起作用,并在第一个任务后结束
- parsing - Dart 语言是如何解析的(从左到右,接收等)?
- spring-security-oauth2 - OAuth2 身份验证 Web 服务调用后端客户端
- javascript - 使用静态类属性时 Node.js 的巨大性能问题
- ionic-framework - Ionic 4 页面导航
- google-cloud-platform - GCP和GSC的多个Google-site-verification元标记?
- c# - 如何将相关表添加到不相关表?
- google-apps-script - 注销后清除导航堆栈 - Gmail 插件