Launch
FastAPI with
Launch a new FastAPI project and you will instantly have access to a development environment. No sign-up required.
Launch a new FastAPI project and you will instantly have access to a development environment. No sign-up required.
Diploi
Choose some optional add-ons to launch with FastAPI
Link to the full guide https://diploi.com/blog/hosting_fastapi_apps
The default Python version is 3.12. You can change it in two ways:
PYTHON_VERSION environment variable - set this in diploi.yaml as a static ENV under your component’s environment variables. This controls the version used by both the development and production environments..python-version file - add a .python-version file to your component’s folder containing just the version number (e.g. 3.11). This is the standard convention used by uv and other Python tools, and is a good choice if you want the version pinned in your repository.If both are set, the .python-version file takes precedence.
The development server is started with:
uv run --with uvicorn uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload --reload-dir src --reload-dir .venv/lib
This can be changed with the containerCommands.developmentStart field in diploi.yaml.
Builds a production-ready image. During the build, dependencies are installed with uv sync or uv pip install. When the container starts, it runs:
uv run --with uvicorn uvicorn src.main:app --host 0.0.0.0 --port 8000 --proxy-headers
This can be changed with the containerCommands.productionStart field in diploi.yaml.
Diploi is the single SaaS service for managing, developing and hosting your full application.