1

我正在尝试在烧瓶中配置数据库,但是每当我运行该应用程序时都会出现错误:- ImportError:没有名为 flask_peewee.db 的模块

from flask import Flask
from flask_peewee.db import Database

app = Flask(__name__)
app.config.from_object(__name__)

DATABASE = {
    'name': 'flasktesting.db',
    'engine': 'peewee.SqliteDatabase',
}
DEBUG = True
SECRET_KEY = 'ssshhhh'

app = Flask(__name__)
app.config.from_object(__name__)

# instantiate the db wrapper
db = Database(app)



@app.route('/')
def Hello_World():

    return ' Are You Ready !!!!!!!!'

if __name__ == '__main__':
    app.run()
4

1 回答 1

4

你真的flask_peewee安装了吗?我运行了您的代码,它与安装的 flask_peewee 完美配合。尝试运行pip install flask_peewee

于 2013-10-10T11:13:35.263 回答