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

# Python applications

Our cPanel hosting supports Python web applications through the **Setup Python App** feature (CloudLinux Python Selector), which runs WSGI applications such as Flask and Django via Phusion Passenger.

## Creating a Python application

1. Log in to cPanel.
2. In the **Software** section, click **Setup Python App**.
3. Click **Create Application** and complete the form:
   * **Python version:** choose the version your app needs.
   * **Application root:** folder for the app (e.g. pyapp), relative to your home directory.
   * **Application URL:** domain or subdomain/path where the app is served.
   * **Application startup file:** typically passenger\_wsgi.py (created automatically).
   * **Application Entry point:** the WSGI callable, typically application.
4. Click **Create**.

cPanel creates a virtual environment for the app and wires up the URL.

## A minimal Flask example

Activate the app's virtual environment over [SSH](/web-hosting/files-and-access/secure-shell-ssh-overview) (the activation command is displayed at the top of the app's page in cPanel), then:

```shell theme={null}
pip install flask
```

Create app.py in the application root:

```python theme={null}
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello from Python on Stablepoint!'
```

Edit passenger\_wsgi.py to load it:

```python theme={null}
from app import app as application
```

Then click **Restart** on the app in cPanel.

## Installing dependencies

With the virtual environment activated over SSH:

```shell theme={null}
pip install -r requirements.txt
```

Or add packages one at a time with pip install. cPanel's Python App page also lets you install packages listed in a requirements.txt via the interface.

## Django notes

Django works well under this setup:

* Point passenger\_wsgi.py at your project's WSGI module:

```python theme={null}
from myproject.wsgi import application
```

* Run management commands (migrations, collectstatic) over SSH inside the virtual environment.
* Serve static files from a folder mapped under your document root, or via WhiteNoise.

## Troubleshooting

* Check stderr.log in the application root for startup errors.
* After code changes, always **Restart** the application.
* Import errors usually mean dependencies were installed outside the app's virtual environment — activate the right environment and reinstall.

If you need help getting a Python application running, our support team is happy to assist.
