Home  >  Q&A  >  body text

python - render_tempalte 不能加载目录下文件

from __init__ import static
from flask import render_template,url_for

@static.route('/')
def test():
    return render_template("static/test_page.html")

只有在__init__的蓝图中设置template_folder才能勉强读取到html 但是js css就怎么也读取不到 url_for也试过了

PHP中文网PHP中文网2741 days ago470

reply all(0)I'll reply

No reply
  • Cancelreply