Is there any documentation on how to support autom...
# general
a
Is there any documentation on how to support automatic reload of applications. For instance, using FastAPI, is there a way to support running with the application --reload so that the application will automatically update itself and avoid having to shut down the application and re-start it manually?
1
h
Are you talking about running a development server with
pants run
?
a
Yes
h
You can set
restartable=True
on the file and use
pants run path/to/main.py
(run the source file, not the pex_binary target)
The link is to an example using the Django development server, but it's the same principle
this uses Pants's own file-watching to restart if any of the files that the server depends on change
a
Thank you