I use Flask BluePrint in my applications and should have the main parts: 1. Admin and 2. Public. When I try to import loginManager into the views.py file, I get an ImportError error message: it is not possible to import the name lm
my folder structure is similar:
~/LargeApplication
|
|
|__ /env
|__ /app
|
|
|
|
|
|__ /templates
|
|__ ..
|__ .
I initialize LoginManager () in __ init__.py / app / __ init__.py
from flask.ext.login import LoginManager
lm = LoginManager()
lm.init_app(app)
lm.login_view = 'login'
and when I try to import lm to /app/admin/views.py
from app import lm
it raises ImportError.
ImportError: cannot import name lm
Could you tell me what could be the problem?
source
share