Reload Flask app when template file changes

前端 未结 10 1611
栀梦
栀梦 2020-11-27 13:04

By default, when running Flask application using the built-in server (Flask.run), it monitors its Python files and automatically reloads the app if its code cha

10条回答
  •  無奈伤痛
    2020-11-27 13:34

    For me works just fine:

     from flask import Flask, render_template, request, url_for, redirect
     app = Flask(__name__)
     app.config["TEMPLATES_AUTO_RELOAD"] = True
    

    See more on http://flask.pocoo.org/docs/1.0/config/

提交回复
热议问题