flask-debugtoolbar ImportError:没有名为flask_debugtoolbar的模块

时间:2017-07-31 09:26:35

标签: python flask pip flask-sqlalchemy

我已经完成了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

1 个答案:

答案 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()