【发布时间】:2021-02-05 09:03:04
【问题描述】:
我有一个带有垂直和水平菜单栏的 base.html 文件:
无论我想在哪里使用,我只需要写:
{% extends 'base.html' %}
{% block content %}
//html code
{% endblock content %}
但我不知道如何在 djando admin 的模板目录中使用相同的文件 base.html。
我想要这样的输出:
我尝试了什么:
How to override and extend basic Django admin templates?
How do I correctly extend the django admin/base.html template?
Override Navbar in Django base admin page to be same as the base.html
我尝试了一些其他解决方案,只是不想增加问题的长度,base.html 文件的代码只有基本的引导程序,菜单的 html 代码。
我是 Django 新手,不胜感激!
【问题讨论】: