错误提示如下:
Traceback (most recent call last): File
"/Users/duzhipeng/project/manage.com/run.py", line 3, in
app = create_app() File "/Users/duzhipeng/project/manage.com/app/init.py", line 11,
in create_app
db.init_app(app) TypeError: init_app() missing 1 required positional argument: 'app'
Process finished with exit code 1
其中,run.py:
from app import create_app
app = create_app()
if __name__ == '__main__':
app.run(debug=True)
另一个文件:app/init.py:
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy
def create_app():
app = Flask(__name__)
app.config.from_object('config')
db.init_app(app)
from . import views as manage_blueprint
app.register_blueprint(manage_blueprint)
return app
希望帮我解决问题的大哥留下支付宝账号,10元一个问题,防止我以后不动脑。这次真的不明白错哪了,看了好些资料了。
添加回答
举报
0/150
提交
取消