flask - Python import error. Circular imports -
i'm creating simple flask app. i'm using blueprints provide views , openid login. have faced problem when try import created openid object file views interpreter throws import error.
traceback (most recent call last): file "/.../proglist/proglist.py", line 11, in <module> views_admin import views views_a file "/.../proglist/views_admin.py", line 4, in <module> proglist import open_id file "/.../proglist/proglist.py", line 11, in <module> views_admin import views views_a importerror: cannot import name 'views'
proglist.py
# importing views views import views views_admin import views views_a ... open_id = openid(app, 'temp_dir_path')
views_admin.py
from proglist import open_id ... @views.route("/login", methods=["get", "post"]) @open_id.loginhandler def login():
i have been struggling problem hours , couldn't find answer. thank help.
in proglist
, import views_admin
, in views_admin
, import proglist
. cannot resolved. typical approach here outsource third file both can safely access without interfering each other. looks of it, might want move open_id
different file.
Comments
Post a Comment