External Exam Download Resources Web Applications Games Recycle Bin

Detecting changes

debugtrue.py

from flask import *
app = Flask(__name__)

@app.route("/")
def main():
  return("change this text and save - server will autoreboot")
 
app.run(debug=True) #because of this: (debug=True)
Setting debug=True in the app.run() method call will detect changes in any server-side PY or HTML template file:



This will save you lots of time not having to 'restart' your server after every change / save. It will also display console errors to the web browser window, which makes it a security risk on any live server. But i find it easier to read the errors from the python console, but whatever you prefer is fine - the information is the same: