You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we also need to change the introduction paragraphs in Settings:
Use the following options to configure Uvicorn, when running from the command line.
If you're running programmatically, using uvicorn.run(...), then use equivalent keyword arguments, eg. uvicorn.run("example:app", port=5000, reload=True, access_log=False). Please note that in this case, if you use reload=True or workers=NUM, you should put uvicorn.run into if __name__ == '__main__' clause in the main module.
You can also configure Uvicorn using environment variables with the prefix UVICORN_. For example, in case you want to run the app on port 5000, just set the environment variable UVICORN_PORT to 5000.
!!! note
CLI options and the arguments for uvicorn.run() take precedence over environment variables.
Also note that UVICORN_* prefixed settings cannot be used from within an environment configuration file. Using an environment configuration file with the --env-file flag is intended for configuring the ASGI application that uvicorn runs, rather than configuring uvicorn itself.
Suggestion ⬇️
Use the following options to configure Uvicorn, when running from the command line.
These options are mirrored as keyword arguments when [running programmatically](/index.md#running-programmatically).
Default settings can also be passed as environment variables using the `UVICORN_` prefix. For example, setting `UVICORN_PORT` to `5000` would make Uvicorn serve on port 5000 if `--port` (when using the CLI) or `port` (when running programmatically) have not been passed.
A simple visual representation of what takes precedence would give developers a quick understanding. Since we have multiple levels of precedence, writing would become too wordy 🤔
Nice addition!
I think we also need to change the introduction paragraphs in Settings:
Suggestion ⬇️
Originally posted by @florimondmanca in #1525 (review)
The text was updated successfully, but these errors were encountered: