I want my FastAPI app to reload when a .csv file in the same directory changes.
I tried the following command, but it isn't working.
uvicorn main:app --reload --reload-include *.csv
Does anyone know a solution to this problem?
As per Uvicorn documentation, you can install watchfiles, and use --reload-include, as well as --reload-exclude, to specify other file extensions. For example:
uvicorn main:app --reload --reload-include *.csv
According to Uvicorn Documentation, --reload-include does work only if optional dependency Watchfiles (previously called watchgod) is installed.
Try installing it with pip install watchfiles and then run uvicorn again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With