Python 烧瓶:多个蓝图相互干扰

Python 烧瓶:多个蓝图相互干扰,python,flask,Python,Flask,我正在用蓝图测试烧瓶。我的应用程序有两个蓝图: 基地 意见 基本/初始 base = Blueprint('base', __name__, static_folder='static', template_folder='templates') #http://server.com/base opinions = Blueprint('opinions', __name__, static_folder='static', template_folder='templates') #htt

我正在用蓝图测试烧瓶。我的应用程序有两个蓝图:

  • 基地
  • 意见
  • 基本/初始

    base = Blueprint('base', __name__, static_folder='static', template_folder='templates') 
    #http://server.com/base
    
    opinions = Blueprint('opinions', __name__, static_folder='static', template_folder='templates')
    #http://server.com/opinions
    
    app = Flask(__name__)
    from app.base import views 
    from app.base import base
    app.register_blueprint(base, url_prefix='/base')
    
    from app.opinions import views
    from app.opinions import opinions
    #app.register_blueprint(opinions, url_prefix='/opinions')  <-- Uncommenting this line causes issues
    
    意见/初始值

    base = Blueprint('base', __name__, static_folder='static', template_folder='templates') 
    #http://server.com/base
    
    opinions = Blueprint('opinions', __name__, static_folder='static', template_folder='templates')
    #http://server.com/opinions
    
    app = Flask(__name__)
    from app.base import views 
    from app.base import base
    app.register_blueprint(base, url_prefix='/base')
    
    from app.opinions import views
    from app.opinions import opinions
    #app.register_blueprint(opinions, url_prefix='/opinions')  <-- Uncommenting this line causes issues
    
    __初始值

    base = Blueprint('base', __name__, static_folder='static', template_folder='templates') 
    #http://server.com/base
    
    opinions = Blueprint('opinions', __name__, static_folder='static', template_folder='templates')
    #http://server.com/opinions
    
    app = Flask(__name__)
    from app.base import views 
    from app.base import base
    app.register_blueprint(base, url_prefix='/base')
    
    from app.opinions import views
    from app.opinions import opinions
    #app.register_blueprint(opinions, url_prefix='/opinions')  <-- Uncommenting this line causes issues
    
    app=Flask(\uuuuu name\uuuuuu)
    从app.base导入视图
    从app.base导入base
    app.register\u blueprint(base,url\u前缀='/base')
    从app.options导入视图
    来自app.OPTIONS导入意见
    
    #app.register_blueprint(意见,url_前缀='/opinions')全局注册蓝图模板目录。它们共享一个名称空间,以便您的应用程序可以在必要时覆盖blueprint的模板。这一点在文件中被简要地提到


    因此,您不应该将您的意见模板命名为
    index.html
    ,而应该命名为
    意见/index.html
    。乍一看(
    ../Observices/templates/Observices/…
    )这会让路径变得笨拙,但会增加在不更改蓝图内容的情况下自定义“罐装”模板的灵活性。

    请在模板和生成的html行中包含静态的示例用法。@Paolocascello-您的评论肯定有帮助。不是静态文件,而是错误的模板。我已经对问题进行了适当的编辑。可能是