Python Apps

Updated Nov 18, 2026 Markdown

/admin/python-apps lists every Python application across all accounts (one row per app). Filter by account, runtime version, status (running / stopped / errored). Per-app drill-down:

OverviewOwning account, app slug, listen port, runtime, process state, last error, requirements.txt path, virtualenv path, gunicorn workers
SettingsRuntime version (3.10 / 3.11 / 3.12), entry point module, environment variables (KEY=VALUE), worker count (capped by plan python_workers_limit), max memory (capped by plan python_max_memory_mb)
Logsgunicorn's own error and access logs (<app>-error.log, <app>-access.log, last N lines); the web server's lines for the app's domain are on the Logs page under that domain
ActionsStart / stop / restart, install requirements (long-running, SSE stream), reset state (clears any "errored" flag without restarting)

The agent provisions a per-app systemd unit + nginx reverse-proxy snippet on activation. The plan's max_python_apps caps how many apps an account may create — 0 means no limit; one more than the limit is refused with 403 PYTHON_APP_LIMIT.

Domain binding. An app's domain must already belong to the account it is created for — its primary, addon or subdomain name. Any other name, including another account's domain and the server's own hostname, is refused with 404 DOMAIN_NOT_FOUND on both create and update; add the domain to the account first. The rule holds for admin and API callers too, since the vhost the app writes decides who serves that name.

Environment variables. The app's variables are saved as a whole set. When they cannot be read, the tab shows an error state with a Retry button and its Save stays off — saving would otherwise replace every stored variable with the ones on screen. The Node.js apps page behaves the same.

Files the agent writes in the account's home. The app's .env and gunicorn.conf.py, the skeleton files of a new app, the per-app log files (in the account's log folder outside the home, /var/log/whost-accounts/<account>/) and the .gunicorn state folder are written, read and removed through directory handles, so a link the account placed at one of those names is never followed: a save or a create whose name stands on a link, a folder or a file with a second hard link is refused with 422 VALIDATION_ERROR (details.field names the entry; the panel reports the save as failed), a log view reads such a name as empty, and a deploy whose app folder name is a link stops with "The application folder is missing or is not a plain folder under the account home directory." A deploy's media folder (media_dir, a relative path) always lands under the app folder. The same holds for Node.js apps. Analyzing a server path reads the project the same way: a file or folder whose name leads out of the account's home (a requirements.txt, package.json, source file or media folder that is a link out) counts as absent — its content, size and names are not used, while a link that stays inside the home still works; a Node.js project whose package.json is such a link shows the warning "package.json could not be read: it is not a plain file inside the account home.", and a server-side archive is unpacked from a descriptor opened without following a link (a name swapped for a link answers 422 VALIDATION_ERROR, details.field: server_path); a migration deploy's SQL dump in the account home is imported from such a descriptor too (a name that is a link by then is skipped with the deploy log line "SQL dump is not a plain file inside the account home"), and so is a media archive there ("Media archive is not a plain file inside the account home"), whose entries are written into the media folder through its handle. A deploy from a server path copies the source folder (and a media folder) through a handle of the folder its path check saw, every level opened without following a link: a folder on that path swapped for a link after the check stops the deploy with "The source folder is not a plain folder (a link stands on its path)." (details.field: source_path). A name on that path renamed while the path itself is being checked is refused before the deploy starts: 422 VALIDATION_ERROR, the same field, "The source path changed while it was being checked …" — start the deploy again. Account logs live outside the homes. Every web server's per-domain access and error logs, php-error.log and the per-app logs (a Node.js app's output, gunicorn's access / error logs of a Python app) are written to the account's log folder /var/log/whost-accounts/<user>/ (root:<account group> 0750; the base /var/log/whost-accounts is root:root 0711), under the names they always had. Every root process that opens them by path — the web server masters (nginx, Apache, OpenLiteSpeed), systemd for an app's output, logrotate (/etc/logrotate.d/whost-accounts, glob /var/log/whost-accounts/*/*.log) and fail2ban — therefore opens a path no account can rename; PHP-FPM and gunicorn still write as the account (its group passes through the folder). The account sees the folder through a logs link in its home (made at the agent's start, on account creation, on app creation and after a restore, when that name is free; a name the account placed there is left as it is and never followed) and through the panel: the Logs pages, the app log tabs and the File Manager, which opens logs read-only as that folder. A backup carries the folder's files as logs/ as before; removing an account removes its log folder; the disk usage shown counts the home and the log folder. An existing install moves once, at the first agent start of this version: the files the agent generated that name <home>/logs (vhosts of every web server, PHP-FPM pools, Node.js / Python units, gunicorn configurations, logrotate rules — a hand-written rule that names /home/*/logs/ too — and the web jail file) get the new path and nothing else, the originals kept under /var/lib/whost/account-logs-move-<time>-separate/files/; each account's <home>/logs is emptied into its folder by renaming its files (on one filesystem the open files stay the same, so no line is lost and no application is restarted; across filesystems the files are copied and the old folder is kept as <home>/.logs-moved-<time>) and gives way to the link; every installed web server is tested, then the running ones, the PHP-FPM versions whose pools changed and systemd are reloaded; a test that passed before and fails after puts every file and log back. The agent log names the move (account logs moved out of the homes …) and /var/lib/whost/agent_state.json records it (account_logs_layout: separate). Going back to a version that writes logs into the homes: stop the agent, run cd /opt/whost/agent && /opt/whost/venv/bin/python3 -m whost_agent.services.account_logs_move --to home as root (the logs and the paths go back the same way), then install the earlier version; starting this version again moves them out again. A tool of your own that reads these logs (a log watcher, a statistics job) reads them at the new path. A new account's panel folders (public_html, tmp, ssl, backups, mail) and its default page are made through the home's handle too, so a folder name that already holds a link stops the creation with 422 VALIDATION_ERROR ("'public_html' in the account home is not a plain folder.", details.field names the folder) and the account is rolled back — the administrator's and a reseller's Create Account form show that message.

Endpoints used: GET /accounts/{u}/python-apps, POST /accounts/{u}/python-apps, GET/PUT/DELETE /accounts/{u}/python-apps/{app}, POST /accounts/{u}/python-apps/{app}/{start,stop,restart}, POST /accounts/{u}/python-apps/{app}/install-requirements, GET /accounts/{u}/python-apps/{app}/logs.

Still Need Help?

Our support team is here around the clock for anything you can't find above.