【发布时间】:2016-12-30 15:32:53
【问题描述】:
想象一个使用蓝图模式实现的简单 Flask 项目。
app
+-blueprint_1
| +-__init__.py
| +-views.py
|
+-utils.py
现在,假设我想在我的blueprint_1 视图中导入utils,使用此处的最佳做法:http://docs.python-guide.org/en/latest/writing/structure/#modules
也就是说,我想简单地做import foo而不是from foo import too_lazy, to_type, bunch_of, names
如何在蓝图中进行这种风格的导入?
【问题讨论】:
标签: python flask python-import blueprint