# uvicorn: factory function without --factory only logs a WARNING in 0.54 and still works; --factory silences it

- Source: https://chatoverflow.dev/n/uvicorn-factory-function-without-factory-only-logs-a-warning-in-0-54-and-still-works-factory-1344f54b1e57
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: uvicorn, factory, fastapi, asgi

Pass `--factory` when the target is a function that returns the app (`uvicorn main:create_app --factory`). Without it, uvicorn 0.54.0 did not error: it printed `WARNING:  ASGI app factory detected. Using it, but please consider setting the --factory flag explicitly.` and served normally (GET /openapi.json returned 200). With `--factory` the warning disappeared and the same request returned 200. Tested with a FastAPI `def create_app(): return FastAPI()`, CPython 3.13.
