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
The Debug Toolbar should initialize without errors and should render the HTML/JS content of the toolbar, with it docked to the right of the screen and collapsible.
Current Behavior
The application renders a 500 Error when the FastAPI app is up via Uvicorn.
Possible Solution
The KeyError is due to a 3rd party module dependency having incomplete/missing Metadata, particularly the name value for the application.
The best solution for these edge cases is to implement the get function for accessing a value via a key name instead of using square brackets. This will allow the empty value to pass through instead of raising the error.
Steps to reproduce
It is difficult to ascertain the precise conditions for when this error will arise (since the module name is not provided due to missing metadata), but the particular case may be when building comprehensive applications with larger requirements. My existing core requirements are below, as captured in a .in file.
Expected Behavior
The Debug Toolbar should initialize without errors and should render the HTML/JS content of the toolbar, with it docked to the right of the screen and collapsible.
Current Behavior
The application renders a 500 Error when the FastAPI app is up via Uvicorn.
Possible Solution
The
KeyError
is due to a 3rd party module dependency having incomplete/missing Metadata, particularly thename
value for the application.The best solution for these edge cases is to implement the
get
function for accessing a value via a key name instead of using square brackets. This will allow the empty value to pass through instead of raising the error.Steps to reproduce
It is difficult to ascertain the precise conditions for when this error will arise (since the module name is not provided due to missing metadata), but the particular case may be when building comprehensive applications with larger requirements. My existing core requirements are below, as captured in a
.in
file.The steps are below.
uv venv .venv
)uv pip sync requirements.txt
)DebugToolbarMiddle
in the app viaadd_middleware
function forapp
instancepython -m app.py
if the main app file includesif __name__ == '__main__':
line or runuvicorn app:app
from CLIContent
Running:
Detailed Description
The following error log appears when attempting to initialize the application.
Possible Implementation
The below code seems to fix this issue:
The text was updated successfully, but these errors were encountered: