flask - NameError: name 'app' is not defined
www.py4u.net › discuss › 160886You are using the app before importing it, here lm.init_app(app), app is not defined yet. It should look like this: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy import os from flask.ext.login import LoginManager from flask.ext.openid import OpenID from config import basedir app = Flask(__name__) app.config.from_object('config') lm= LoginManager() lm.init_app(app) oid ...
[Solved] Python flask NameError: name 'app' is not defined ...
coderedirect.com › questions › 353258You are using the app before importing it, here lm.init_app(app), app is not defined yet. It should look like this: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy import os from flask.ext.login import LoginManager from flask.ext.openid import OpenID from config import basedir app = Flask(__name__) app.config.from_object('config') lm= LoginManager() lm.init_app(app) oid ...