文档中是这么说的: Flask 将会在 templates 文件夹中寻找模版。因此如果你的应用是个模块,这个文件夹在模块的旁边,如果它是一个包,那么这个文件夹在你的包里面:
Case 1: 一个模块:
/application.py /templates /hello.html Case 2: 一个包:
/application /__init__.py /templates /hello.html 这是不是规定死了模板的位置?我在代码中调用 render_template 发现自己指定模板目录是不行的
