我已经完成了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
答案 0 :(得分:1)
安装强>
pip install flask_debugtoolbar --upgrade
<强>体强>
将body
添加到您的html页面:
@app.route('/', methods=['GET', 'POST'])
def index():
return '<body><a href="/admin/">Click me to get to Home!</a></body>'
app.run()