0

I am new to flask.

Change the contents of index.html file and then again run the app.py , changes don't get reflected. I only see the previous index.html file data.

Below is the code snippet,

from flask import Flask, render_template

app = Flask(__name__)

@app.route("/")
def home():
    return render_template("index.html")


if __name__ == '__main__':
    app.run()


Snehal Hodage
  • 61
  • 2
  • 5
  • 1
    There are a few possibilities: your browser could be aggressively caching the old version, try clearing your cache (refresh with ctrl-shift-r on Windows/Linux, cmd-shift-r on Macs). Others: are you sure you *saved* the changes you made to the HTML file? Also generally it is not necessary to restart your flask application, refreshing the page *should* be enough to see changes to an html file or template. That should get you started, but in order to help you more we'll need you to post a minimal reproduction case, otherwise we're just guessing. – Jared Smith Jan 06 '21 at 11:51
  • Related (and possible helpful) is [this](https://stackoverflow.com/questions/9508667/reload-flask-app-when-template-file-changes) post – costaparas Jan 06 '21 at 14:36

0 Answers0