Reputation: 221
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?
Upvotes: 19
Views: 13032
Reputation: 110
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
Upvotes: 7
Reputation: 281
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
Upvotes: 23