pallets/flask

Flask server doesn't reload when templates modifies

guillermomf2001 opened this issue · 3 comments

Flask server doesn't reload when templates modifies

First I created a Flask server with a virtual environment with venv and I installed python-dotenv and libsass following the instructions of their respective official websites.

After that I created a package called 'store' in a folder with the same name.

Then I created a 'store/templates/home.html' and a 'store/static/scss/style.scss'

All works right but I need to reload the browser manually every time I have to modify either *.html or *.scss files of the templates.

I expected browser reloads automatically every time I need to modify a template or css style.

Environment & modules:

  • Windows 10

  • Git Bash terminal

  • VS Code

  • Chrome 114

  • Python version: 3.10

  • Flask version: 2.3.2

  • python-dotenv 1.0.0

  • libsass 0.22.0

We don't implement hot reloading within the browser window, only reloading the server itself on code changes. I'm fairly sure there's some extension that provides this.

Thanks for the answer @davidism

The issue is that the Flask server doesn't reload when the template code changes either.

Yes it does. But it doesn't reload the rendered output in the current browser page. That's what I meant before with "hot reloading within the browser".