【发布时间】:2017-03-11 20:14:24
【问题描述】:
我正在制作一个 django 应用,但无法在 views.py 文件中导入自定义模块。
我正在尝试从 integrations/views.py 的模块文件夹中的 auth.py 导入类“Integrate”
我尝试将 init.py 放在 app 文件夹和模块文件夹中,但还是不行。
views.py:
from ..modules.auth import Integrate
Powershell:
from ..modules.auth import Integrate
ValueError: Attempted relative import beyond toplevel package
【问题讨论】: