最佳答案
我想提供相同的内容内2个不同的基础文件。
所以我试着这么做:
返回文章页面
{% extends "base1.html" %}
{% include "commondata.html" %}
返回文章页面
{% extends "base2.html" %}
{% include "commondata.html" %}
问题是我似乎不能同时使用扩展和包含。有什么办法吗?如果没有,我怎样才能完成上述任务?
Html 覆盖在 base1.html 和 base2.html 中指定的块
The purpose of this is to provide the same page in both pdf and html format, where the formatting is slightly different. The above question though simplifies what I'm trying to do so if I can get an answer to that it will solve my problem.