How a Python site runs
A Python site is a WSGI application served by gunicorn as a systemd unit, aurapanel-site-<domain>.service, running as the site's Linux user on a loopback port. nginx proxies the domain to that port with HTTPS. The unit runs, in effect:
/usr/bin/gunicorn --chdir /home/<user>/htdocs/<domain> --bind 127.0.0.1:<port> main:app The panel runs and supervises the process. It does not create a virtual environment, install requirements or detect your entry point: you supply the module and install the dependencies. This keeps the panel out of your Python tooling choices.
Prerequisites
- Python 3 installed under Services → Packages (the panel installs
python3,python3-venvandpython3-pip), or with--python=yesat install time. - gunicorn at
/usr/bin/gunicorn:sudo apt install gunicorn. The unit refuses to start without it and says so. - A WSGI application object, for example
appinmain.py(Flask, Django'swsgi.application, Bottle, Falcon).
Create the site and deploy
- Sites → Add site → Python. Enter the domain, accept the suggested app port, and set the app module in gunicorn's
module:callableform. The default ismain:app. - Create. The unit exists but has nothing to run until your code is in place.
- Deploy into the document root and install dependencies as the site user. A virtual environment inside the document root is the simplest layout; the system gunicorn will import your app with the interpreter it was installed for, so install packages for the same Python, or point gunicorn at your venv from a wrapper if you need isolation:
sudo -u <site-user> -i
cd ~/htdocs/example.com
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
exit
sudo systemctl restart aurapanel-site-example.com gunicorn is the distribution package running under the system Python. Packages installed only inside .venv are visible to it only if you make them so (for example a .pth file, or installing them system-wide for the site user with pip install --user). Check the journal after the first restart.
Environment your app receives
PORTandHOST=127.0.0.1: gunicorn is already bound for you; these are informational.TZwhen the site has a time zone.- Your own variables from a
.envfile in the document root, loaded before the panel's. REDIS_URL,REDIS_HOST,REDIS_PORT,REDIS_KEY_PREFIXwhenrequirements.txt,pyproject.tomlorPipfiledeclares a Redis client and Redis is installed.
The domain serves your application over HTTPS and journalctl -u aurapanel-site-example.com shows gunicorn's workers booting.
Restarts and logs
Same policy as Node.js sites: Restart=always with back-off, parked as failed after five failures in a minute, 10 seconds to stop. Logs go to the journal and the site's Logs tab; nginx logs are in /home/<user>/logs/.
Common messages
"gunicorn is not installed at /usr/bin/gunicorn — install it (e.g. apt install gunicorn) before deploying the Python site …"
Install the package and restart the unit.
"dependency install is only for Node.js sites"
The Install dependencies action does not apply to Python. Install with pip as shown above.
ModuleNotFoundError in the journal
gunicorn cannot import your module: the app module field is wrong, or the dependency is installed for a different interpreter than the system gunicorn uses.