> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python overview

> Discover more about running Python applications and sites on Sevalla.

[Python](https://www.python.org/) is a versatile, high-level programming language widely used for building web applications and backend services. Its simplicity, readability, and extensive ecosystem of libraries and frameworks make it ideal for app hosting. Popular web frameworks, such as Django, Flask, and FastAPI, provide tools for routing, templating, database management, and API development, enabling developers to build scalable applications efficiently. Python also supports integrations with task queues, caching systems, and cloud services, making it well-suited for deploying modern web apps on Sevalla.

## Framework guides

* [Django](https://docs.sevalla.com/quick-starts/python/django)
* [FastAPI](https://docs.sevalla.com/quick-starts/python/fastapi)
* [Flask](https://docs.sevalla.com/quick-starts/python/flask)

## Best practices

### Use a hosted database

In most cases, SQLite databases are not suitable for production. Instead, you can use a hosted database on Sevalla for your app.

[Create a database](https://docs.sevalla.com/databases/get-started/add-a-database) in Sevalla and select either Postgres, MySQL, or MariaDB.

You can also [add an internal connection](https://docs.sevalla.com/applications/networking#add-a-private-connection) from the application to the database to add the required environment variables.

### Migrations

Migrations must run after your image has been built but before the container is started. We recommend [creating a job](https://docs.sevalla.com/applications/processes#job-process) to run the migrate command before deployment.

### Background tasks

We recommend using Celery and Redis for your background tasks. However, you can use other task queues, such as Huey and RQ.

### Caching

Use Redis caching to help reduce database load, lower latency, and improve scalability for web applications. Within Sevalla, you can [create and connect a Redis database](https://docs.sevalla.com/databases/get-started/add-a-database) to your Python app.

We also recommend using Sevalla’s CDN and edge caching to maximize performance.

### Health checks

To support zero-downtime deployments, we recommend configuring a health check endpoint in your Python application. This allows Sevalla to verify that your app is running correctly before routing traffic to it.

There are multiple ways to implement health checks in Python, depending on the level of control and visibility required.
