Skip to content
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

Allow setting APP with envvar UVICORN_APP #2106

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Conversation

aceat64
Copy link
Contributor

@aceat64 aceat64 commented Sep 20, 2023

Summary

Allows configuring the APP setting using the environment variable UVICORN_APP. Currently environment variables can be used for all other settings thanks to click's auto_envvar_prefix, but this applies only to options and not to arguments.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

I'm not sure if a new test is needed for this change. Additionally, I believe no documentation changes are needed. The docs currently state that env vars can be used for configuration but doesn't call out the caveat that APP can not.

@Kludex
Copy link
Member

Kludex commented Sep 21, 2023

Thanks @aceat64 :)

@Kludex Kludex merged commit 8e68642 into encode:master Sep 21, 2023
@aceat64 aceat64 deleted the app-envvar branch September 22, 2023 14:20
br3ndonland added a commit to br3ndonland/inboard that referenced this pull request Dec 31, 2023
Uvicorn 0.24.0 adds support for setting the app instance with the
environment variable `UVICORN_APP`. inboard already has an environment
variable for this purpose, `APP_MODULE`.

This commit will add support for `UVICORN_APP`. Either `APP_MODULE` or
`UVICORN_APP` can be used to set the app module for inboard, with
precendence given to `APP_MODULE` for backward compatibility.

https://github.com/encode/uvicorn/releases/tag/0.24.0
encode/uvicorn#2106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants