from flask import Flask, render_template app = Flask(import_name=__name__, static_url_path='/', static_folder='static', template_folder='templates') # 添加html访问路由 @app.route('/') def blog(): return render_template('index.html') if __name__ == "__main__": app.run() # 默认设置host:0.0.0.0 port:5000
标签:__,文件目录,name,flask,app,static,template,模板 From: https://www.cnblogs.com/boye169/p/17679242.html