Functions
import_app
1
ASGIApp
▼
Resolve an application string to an ASGI callable.
import_app
1
ASGIApp
▼
def import_app(app_path: str) -> ASGIApp
Parameters
| Name | Type | Description |
|---|---|---|
app_path |
str |
Application reference in "module:attribute" format. Optionally, the attribute may end with "()" to call a factory. |
Returns
ASGIApp
reimport_app
2
ASGIApp
▼
Re-import an ASGI app, clearing cached local modules first.
Evicts all ``sys.m…
reimport_app
2
ASGIApp
▼
def reimport_app(app_path: str, base_dirs: list[str] | None = None) -> ASGIApp
Re-import an ASGI app, clearing cached local modules first.
Evicts allsys.modulesentries whose source file lives under one
of the base_dirs (defaults to the current working directory), then
re-imports the application viaimport_app(). This forces
Python to re-execute module source, picking up code changes saved
since the last load.
Parameters
| Name | Type | Description |
|---|---|---|
app_path |
str |
Application reference in |
base_dirs |
list[str] | None |
Directories whose modules should be evicted from the module cache. Defaults to None
|
Returns
ASGIApp
_clear_local_modules
1
list[str]
▼
Remove project-local modules from ``sys.modules``.
A module is considered "loc…
_clear_local_modules
1
list[str]
▼
def _clear_local_modules(base_dirs: list[str] | None = None) -> list[str]
Remove project-local modules fromsys.modules.
A module is considered "local" when its__file__attribute
resolves to a path under one of the base_dirs. Third-party
packages (installed in site-packages) and the standard library are
left untouched.
Parameters
| Name | Type | Description |
|---|---|---|
base_dirs |
list[str] | None |
Directories to treat as project roots. Defaults to None
|
Returns
list[str]