Flask
Flask is a minimalist Python framework for APIs, dashboards, and microservices. Use this component when you want Diploi to handle the build steps, gunicorn/uvicorn configuration, and deployments while you focus on routes and extensions.
Add to your project
Section titled “Add to your project”Paste this entry into the components list in diploi.yaml to add Flask to your project.
components: - name: Flask identifier: flask package: https://github.com/diploi/component-flask#v3.1.3-05.2026Flask reference
Section titled “Flask 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 Flask. Here you can also add a frontend framework to create a monorepo app, eg, Flask 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
Full guide at https://diploi.com/blog/hosting_flask_apps
Development
Section titled “Development”uv run flask --app src/main.py run --host=0.0.0.0 --port=8000 --debugThis will:
- Watch for changes and restart the server automatically
- Makes the app available on all network interfaces at port 8000, with debug mode enabled
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 gunicorn -w 4 -b 0.0.0.0:8000 src.main:appThis uses the Gunicorn to serve your application on port 8000.