gpt4 book ai didi

python - flask 调试工具栏导入错误: No module named flask_debugtoolbar

转载 作者:太空宇宙 更新时间:2023-11-03 14:57:27 26 4
gpt4 key购买 nike

我已经完成了 pip install Flask-debugtoolbar 但我仍然收到导入错误

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_debugtoolbar import DebugToolbarExtension

# Create application
app = Flask(__name__)
app.config.from_pyfile('config.py')
db = SQLAlchemy(app)
app.debug = True
toolbar = DebugToolbarExtension(app)

@app.route('/', methods=['GET', 'POST'])
def index():
return '<a href="/admin/">Click me to get to Home!</a>'

import views
import models

最佳答案

安装

pip installflask_debugtoolbar --upgrade

body

body 添加到您的 html 页面:

@app.route('/', methods=['GET', 'POST'])
def index():
return '<body><a href="/admin/">Click me to get to Home!</a></body>'

app.run()

关于python - flask 调试工具栏导入错误: No module named flask_debugtoolbar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45412051/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com