Make it possible to run fastapi run
with a module instead of a path
#167
Replies: 4 comments
-
The mentioned code is from
|
Beta Was this translation helpful? Give feedback.
-
FWIW, uvicorn has a very handy method to load the app from a |
Beta Was this translation helpful? Give feedback.
-
This is incredibly important since running will require modification of all module imports from something like |
Beta Was this translation helpful? Give feedback.
-
This feature will be extremely useful especially for the use case where the application code is packaged using pyproject.toml + src layout (+ potentially also namespace package). For example:
In uses cases like this we often |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Let's say you have your fastapi app packaged up and available in the awesomeapi package.
Wouldn't it be nice if you could run
fastapi run awesomeapi:app
just like you can do withuvicorn awesomeapi:app
?Operating System
Linux
Operating System Details
Python 3.12
Python Version
3.12
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions