Skip to content

Python

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.2026
  1. In the Dashboard, click Create Project +
  2. 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
  3. In Pick Add-ons, you can add one or multiple databases to your app
  4. Choose Create Repository to generate a new GitHub repo
  5. Finally, click Launch Stack

During development, the container installs watchfiles to enable automatic reloads when files change. The development server is started with:

Terminal window
uv run watchfiles "python src/main.py"

This will:

  • Use watchfiles to watch for file changes and restart the server automatically.
  • Run src/main.py in an isolated Python environment managed by uv.
  • Automatically detect whether to use pyproject.toml or requirements.txt for dependency resolution.

Builds a production-ready image. During the build, dependencies are installed with uv sync or uv pip install. When the container starts, it runs:

Terminal window
uv run --frozen src/main.py

This starts your Python application using the exact dependency versions locked in the project.