报错信息**NameError: name 'app' is not defined*
来源:4-9 打造高可用flask mvc框架
醉舞红袖夜添香
2018-12-06
报错信息NameError: name ‘app’ is not defined
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
class Application(Flask):
def init(self,import_name):
super(Application, self).init(import_name)
self.config.from_pyfile(‘config/base_setting.py’)
db.init_app(self)
db = SQLAlchemy( app )
app = Application(name)
from application import app
def main():
app.run()
if name == ‘main’:
try:
import sys
sys.exit(main())
except Exception as e:
import traceback
traceback.print_exc()
运行后找不到app
已经找到原因了
写回答
1回答
-
醉舞红袖夜添香
提问者
2018-12-06
已经解决了
00
相似问题