FASTAPI-DEV(1)

πŸ“¦
version 0.136.3 Β· 4 versions
, in fedora 44

πŸ’– FASTAPI-DEV(1) πŸ’–

okay bestie, listen up β€” this is the manual page for fastapi-dev, a lil command in the User Commands family, and it's literally the glow-up version of running your FastAPI app while you're still building it. it's the dev-mode era. no cap. πŸ§ͺ✨


🌸 NAME 🌸

fastapi dev β€” run a FastAPI app in development mode. πŸ§ͺ


πŸŽ€ SYNOPSIS πŸŽ€

fastapi dev [OPTIONS] [PATH]

✨ DESCRIPTION ✨

so basically? this is the exact same energy as fastapi-run(1), but with two key differences, and they're kind of the whole point:

  • reload is enabled (your server refreshes when code changes, obsessed)
  • it listens on the 127.0.0.1 address (localhost only, cozy and private)

it's also lowkey a genius at figuring out what you meant. it automatically detects the Python module or package that needs to be imported, based on the file or directory path you hand it. πŸ•΅οΈβ™€οΈ

and if you pass it no path at all? it just starts guessing, trying these in order:

  • main.py
  • app.py
  • api.py
  • app/main.py
  • app/app.py
  • app/api.py

it also sniffs out the directory that needs to be added to your PYTHONPATH so the app is actually importable, and adds it for you. no manual export nonsense, we love that for us. πŸ’…

then it goes looking for the FastAPI app object to use. by default it checks the module or package for an object named:

  • app
  • api

and if neither of those exists? it just grabs the first FastAPI app it finds in the imported module or package. main character energy honestly. πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • --host TEXT β€” the host to serve on. for local development on localhost, use 127.0.0.1. if you want public access (say, inside a container), use all the available IP addresses with 0.0.0.0. [default: 127.0.0.1]
  • --port INTEGER β€” the port to serve on. normally you'd have a termination proxy on top (another program) handling HTTPS on port 443 and HTTP on port 80, and it passes the communication through to your app. [env var: PORT] [default: 8000]
  • --reload, --no-reload β€” turn auto-reload of the server on when (code) files change. heads up bestie, this is resource intensive, so only use it during development, fr fr. [default: reload]
  • --reload-dir PATH β€” set the reload directories explicitly instead of just using the current working directory.
  • --root-path TEXT β€” the root path. this tells your app that it's being served to the outside world with some path prefix set up in a termination proxy or similar.
  • --app TEXT β€” the name of the variable that holds the FastAPI app inside the imported module or package. if you don't give it one, it gets detected automatically. [default: None]
  • --entrypoint, -e TEXT β€” the FastAPI app import string, in the format some.importable_module:app_name.
  • --proxy-headers, --no-proxy-headers β€” enable/disable X-Forwarded-Proto, X-Forwarded-For, and X-Forwarded-Port to populate remote address info. [default: proxy-headers]
  • --forwarded-allow-ips TEXT β€” a comma separated list of IP Addresses to trust with proxy headers. the literal * means trust everything (yes, everything, be careful bb).
  • --verbose, -v β€” show detailed startup output and debug logs: how the FastAPI app was discovered, imported, and configured. perfect if you're nosy like me. πŸ™ˆ
  • --help β€” show a help message and exit. the classic.

πŸ¦‹ ARGUMENTS πŸ¦‹

  • PATH β€” a path to a Python file or package directory (with __init__.py files) containing a FastAPI app. if you don't provide one, a default set of paths will be tried. [default: None]

🌈 ENVIRONMENT 🌈

  • PORT β€” the port to serve on; same as the --port option.

πŸ‘‘ SEE ALSO πŸ‘‘

fastapi-run(1), fastapi-deploy(1), fastapi-login(1), fastapi-cloud(1), fastapi-new(1)

fastapi(1)


okay that's the whole page, you're fully caught up bestie πŸ’–βœ¨ this was the FASTAPI-DEV(1) page, dated July 2026, and yeah the version tag is literally just FASTAPI-DEV(1) again β€” iconic of it tbh. now go run your dev server and slay. πŸŽ€πŸ«ΆπŸ’…

πŸ“¦ where this page comes from