我指的是The Flask Mega-TutorialGithub Repo中的这段代码
flasky/
app.py
config.py
app/
__init__.py
...
...
有一句话我不能完全理解
#__init__.py
...
from config import config
...
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
...
...
它如何从包根目录外的config.py
文件导入?你知道吗
我确实找到了一个Dockerfile
带有以下条目
COPY flasky.py config.py boot.sh ./
这是什么意思?这一行是否以某种方式将这些文件添加到路径中?
为什么不把config.py
文件放在/app
文件夹中呢?你知道吗
在Github上也有同样的问题,Miguel回答了这个问题: https://github.com/miguelgrinberg/flasky/issues/154#issuecomment-395907521
引用:
再往下看:
希望有帮助。你知道吗
相关问题 更多 >
编程相关推荐