直接从包内导入东西出错。
来源:3-2 .蓝图构建项目目录
蜥蜴
2017-07-26
home文件夹下的views.py文件中,“from . import home
”引入出错。
Traceback (most recent call last):
File "/Users/apple/PycharmProjects/movie_project/manage.py", line 6, in <module>
from app import app
File "/Users/apple/PycharmProjects/movie_project/app/__init__.py", line 7, in <module>
from app.home import home as home_blueprint
File "/Users/apple/PycharmProjects/movie_project/app/home/__init__.py", line 6, in <module>
from app.home import views
File "/Users/apple/PycharmProjects/movie_project/app/home/views.py", line 5, in <module>
from . import home
ImportError: cannot import name 'home'
写回答
1回答
-
蜥蜴
提问者
2017-07-26
后来发现问题是因为循环引用的问题。
022018-03-03
相似问题