Overview

Uvicorn 0.24, released on November 4, 2023, adds official Python 3.12 support and the UVICORN_APP environment variable.

Main Features

Python 3.12 and UVICORN_APP

Python 3.12 is now fully supported. The new UVICORN_APP variable lets you specify the ASGI application without a command-line argument.

python
# With the environment variable
# export UVICORN_APP=myapp:app
# uvicorn

# Equivalent to:
# uvicorn myapp:app

import uvicorn
import os

os.environ['UVICORN_APP'] = 'myapp:app'
uvicorn.run(host='0.0.0.0', port=8000)

Sources