This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any ideas about how to automate browser refresh when developing a FastAPI app? #1981
Comments
Have you tried uvicorn/gunicorn reload arguments? While they won't reload the browser they will auto reload if you change an endpoint, don't think they auto reload on templates though (i almost never work with templates so if anyone can confirm/deny would be great) On the javascript comparison. I don't completely agree with it, it is widely a standard feature in js because it more closely relies to the design/flow of the program. Most people i know do not use templates and have flask/fastapi as just endpoints, for which the reload argument from above works perfectly. |
I actually didn't understand what live-reload does You can use uvicorn app_name:app --reload Which will automatically apply the changes to your server. But if you are talking about completely refreshing the page(like F5), it's a different case i guess. |
Yes, I'm aware of I was thinking more about the F5 like browser page reload. With |
FYI I had the same problem and solved it in chrome using the following "live reload" extension. |
@gturbo Which settings did you use for the live reload extension? I am trying to reload the swagger docs and set
together with |
@wlad Hi there! I recently found package that helps with this problem, arel. |
FWIW, I have been using a (rather ancient, 2011) ruby-script by a [http://brettterpstra.com](Bret Terpstra), which in turn is based on [a script by a Carlo Zottman](<https://github.com/carlo/haml-sass-file-watcher)) to automatically reload Chrome whenever a change in the mentioned file-types are detected. This to full satisfaction. I couldn't find the original, so I've create a gist of it. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
First check
Background
I've started learning FastAPI to develop web applications. What I am really missing is an automatic Browser refresh after any code change (including static files, templates, etc.). This seems to be a standard feature in almost any Javascript framework. Frontend people have several terms for that: auto reload / refresh, hot reload / refresh (hotreload), live reload / refresh (livereload), ...
May be a good starting point is something like https://github.com/lepture/python-livereload(?) Or should one better stick to something from JS ecosystem?
An old post of mine related to Flask may provide additional background:
https://stackoverflow.com/questions/56972813/how-to-automate-browser-refresh-when-developing-an-flask-app-with-python
The text was updated successfully, but these errors were encountered: