Python applications (Django, Flask) in WHSPanel

Python App Manager runs WSGI and ASGI Python applications (Django, Flask, FastAPI, and others) through the Nginx Unit, which itself manages the processes and virtual environment. Dependencies are installed from requirements.txt, without the need for SSH access. It works on the same principle as Node.js App Manager.

1. Overview

Open in the menu Software well Python. The table shows your applications with columns Application name, Python (version), Type (WSGI or ASGI), Entry module, Status and Actions.

2. How to create an application

  1. Click Create an application.
  2. Application name and Domain.
  3. Python version (for example 3.11).
  4. Application directory Where is the code?.
  5. WSGI/ASGI module: entry point (for example myapp.wsgi:application).
  6. Application type: WSGI for synchronous (Django, Flask) or ASGI for asynchronous.
  7. Environment variables if necessary, then click OK.

3. Application controls

When the application is built, it appears in a table with the same set of controls as Node applications:

ControlWhat does it do?
Start / Stop / RestartStarts, stops, and restarts the application.
pip installInstalls dependencies from requirements.txt into an isolated virtual environment.
EditChanges settings (version, module, environment variables).
DeleteRemoves the application.

Note: for Django a module is usually project.wsgi:application, and in the variable environment you add DJANGO_SETTINGS_MODULE. Before starting, set the code i requirements.txt to the application directory, then run the dependency installation and start the application.