Forums

Flask, html in /templates/ not reloading?

i have a python code, that create or re-write the content of an html page. This page is saved in folder /template/ inside my app folder.

but it seems that the html not "reloading" automatically. I can see the "new" content if i hit the "reload" button automatically. Any idea why?

Flask does not reload the template when it is changed. After you change a template, you need to reload the web app for it to get the new template.

hi, thanks for the help.

i've managed to "reload" the template by adding this configuration:

app.config["TEMPLATES_AUTO_RELOAD"] = True

reference: https://flask.palletsprojects.com/en/1.1.x/config/#TEMPLATES_AUTO_RELOAD

I can confirm that this does work. Templates will reload without having the do a webapp reload from the PA dashboard.

ooh cool!