DocsPython

Deploying Python Applications

Abasthan provides a high-performance environment for Python applications, from simple scripts to complex web applications like Django, Flask, and FastAPI.

1. Choose Your Source

Select your repository from GitHub, GitLab, or Bitbucket. Abasthan works with all major Git providers.

2. Auto-Detection

Our system automatically identifies Python projects by searching for requirements.txt, pyproject.toml, or environment.yml.

3. Environment Configuration

Abasthan creates an isolated environment for each deployment. We support multiple Python versions (3.10, 3.11, 3.12) which can be selected during deployment.

4. Dependency Installation

During the build phase, Abasthan runs pip install -r requirements.txt or uses poetry install to set up your environment.

5. Define Your Start Command

For web applications, you'll need to specify a start command. For example:

  • FastAPI/Flask: gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app
  • Django: gunicorn myproject.wsgi:application
# Example Gunicorn config
bind = "0.0.0.0:8000"
workers = 4
loglevel = "info"

6. Static Files

For Django or Flask apps, ensure your static file management is correctly configured. You can use whitenoise to serve static files efficiently directly from your Python process.