Pass command line arguments to app.state via on_startup or lifespan #2047
Answered
by
dineshbvadhia
dineshbvadhia
asked this question in
Q&A
-
My problem is how to pass command line arguments to a dependency injection. Can this be achieved with app.state via on_startup (or preferably lifespan)? The code below outlines the need. Thanks:
|
Beta Was this translation helpful? Give feedback.
Answered by
dineshbvadhia
Mar 3, 2023
Replies: 1 comment
-
Pass command line arguments into uvicorn startup/shutdown events. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dineshbvadhia
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pass command line arguments into uvicorn startup/shutdown events.