Skip to content

Python Project

Here you can manage Python projects, Python versions, and virtual environments in aaPanel.

Python Project is suitable for deploying frameworks such as Django, Flask, and FastAPI, and supports uWSGI, Gunicorn, and custom startup commands.

Python Project Overview

alt text

How to Install Python

  • Python Environment -> Version management -> All version

alt text

  • Select the version to install (installation process omitted here)
  • If the install fails, please check the install log: /tmp/panelExec.log. Or view the Detail: alt text

How to Create Virtual Environment

Use an existing Python version to create virtual environment

  • Python Environment -> Create virtual environmentalt textalt text

  • Select Python 3.14.3 to create a virtual environment named: testenv

Virtual environment provides an isolated Python environment for the current project.
It helps avoid dependency conflicts and makes package management easier.

Add Python Project

  • WebSite -> Python Project -> Add Project

Please add the project according to your application and fill in the relevant information.

Reference DjangoBlog project: How to Python Project Deploy Djangoblog uWSGI modealt text

How to Enter the Virtual Environment

  • Method 1: Directly enter through the project Terminalalt text

  • Method 2: Get the Python virtual environment path and manually enter it in the terminal alt text Example: Replace the virtual environment path with your own

    source /www/server/pyporject_evn/testenv/bin/activate

    alt text

Verify whether the Python version in the virtual environment matches the Python version used by the project:

python -V

How to Install Dependencies in the Virtual Environment

Enter the project's Environment -> Install

alt text

  • Install a single dependency package alt text

    NOTE

    Equivalent command: pip install package_name. If you install by command line, please enter the virtual environment first.

  • Batch install according to the requirements.txt file alt text

    requirements.txt is a commonly used dependency list file in Python projects. It records the Python packages required by the project and their version information, making it easier to install and manage dependencies in a unified way.

    NOTE

    Equivalent command: pip install -r requirements.txt. If you install by command line, please enter the virtual environment first.

How to Access Python Project via Ports 80/443

  1. Add a domain in the Domain Manager interface, and point the domain's A record to your server IP alt text

  2. Enable mapping in the Mapping interface. After it is enabled, the web service will reverse proxy the project's port alt text

  3. Add an SSL certificate and access the project via HTTPS alt text

Project logs

You can view the project runtime logs through Project logs, and use them to troubleshoot and resolve errors

alt text

Python Project Usage example

Feedback or Suggestions

If you encounter problems or suggestions during use, please contact us through the following methods:

  • (Please describe in detail or provide screenshots)
  1. Email: [email protected]

  2. Forum: https://www.aapanel.com/forum

  3. Discord: https://discord.gg/Tya5yceBpd

  4. Telegram: https://aapanel.com/tg

  5. GitHub: https://github.com/aapanel/aapanel

    If you like aaPanel, please give it a Star