Flask blueprint结构:如何将shared base.html与特定于模块的模板关联

Flask blueprint结构:如何将shared base.html与特定于模块的模板关联,flask,Flask,我有一个烧瓶应用程序,我想与蓝图结构。但是我不知道如何将sharedbase.html与moduleA.html相关联,以便moduleA.html可以扩展它。你能帮我理解我应该怎么做,或者给我指出正确的资源吗?多谢各位 app/ -- app.py -- modules/ -- moduleA/ -- templates/ -- moduleA.html -- main.py -- static/

我有一个烧瓶应用程序,我想与蓝图结构。但是我不知道如何将sharedbase.html与moduleA.html相关联,以便moduleA.html可以扩展它。你能帮我理解我应该怎么做,或者给我指出正确的资源吗?多谢各位

app/
   -- app.py
   -- modules/
      -- moduleA/
         -- templates/
            -- moduleA.html
         -- main.py
   -- static/
      -- templates/
         -- base.html


#### in moduleA.html ###
{% extends base.html %}

#### in base.html ###
<html>
</html>

#### in main.py ###
from flask import Blueprint, render_template

moduleA_bp = Blueprint('moduleA_bp', __name__,
                             template_folder="templates",
                             static_folder="static",
                             static_url_path="assets")

@moduleA_bp.route('/', methods=['GET'])
def view():
  return render_template('moduleA.html')

#### in app.py ###
from flask import Flask
from modules.moduleA.main import moduleA_bp

app = Flask(__name__)
app.register_blueprint(moduleA_bp, url_prefix="/moduleA")


app/
--app.py
--模块/
--模/
--模板/
--moduleA.html
--main.py
--静止的/
--模板/
--base.html
####在moduleA.html中###
{%extends base.html%}
####在base.html中###
####在main.py中###
从flask导入蓝图,渲染\u模板
moduleA_bp=蓝图('moduleA_bp',名称,
template\u folder=“templates”,
static\u folder=“static”,
静态\u url\u path=“资产”)
@moduleA_bp.route('/',methods=['GET'])
def view():
返回呈现模板('moduleA.html')
####在app.py中###
从烧瓶进口烧瓶
从modules.moduleA.main导入模块a\u bp
app=烧瓶(名称)
应用程序注册蓝图(模块A\U bp,url\U前缀=“/moduleA”)
您可以使用“应用程序工厂”创建应用程序,也可以将模板/移动到stactic的相同级别/


谢谢。我去看看!