Python
Add to your project
Section titled “Add to your project”Paste this entry into the components list in diploi.yaml to add Python to your project.
components: - name: Python identifier: python package: https://github.com/diploi/component-python#v05.2026Python reference
Section titled “Python reference”Readme
Section titled “Readme”Operation
Section titled “Operation”Getting started
Section titled “Getting started”- In the Dashboard, click Create Project +
- Under Pick Components, choose Python. Here you can also add a frontend framework to create a monorepo app, eg, Python for backend and React+Vite for frontend
- In Pick Add-ons, you can add one or multiple databases to your app
- Choose Create Repository to generate a new GitHub repo
- Finally, click Launch Stack
Development
Section titled “Development”During development, the container installs watchfiles to enable automatic reloads when files change. The development server is started with:
uv run watchfiles "python src/main.py"This will:
- Use
watchfilesto watch for file changes and restart the server automatically. - Run
src/main.pyin an isolated Python environment managed byuv. - Automatically detect whether to use
pyproject.tomlorrequirements.txtfor dependency resolution.
Production
Section titled “Production”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 --frozen src/main.pyThis starts your Python application using the exact dependency versions locked in the project.