WEB HOSTING

How can I deploy Python on my cPanel hosting?

Python is the most widely used programming language in software development, infrastructure management, and data analysis. It is deployed in CMS platforms like Django-CMS and major sites such as Google, Facebook, and YouTube.

This scripting language, slightly older than PHP, is also considered the easiest to learn and use, especially for beginners, as it allows rapid creation of programs with minimal effort. Moreover, it is compatible with most operating systems and computing platforms.

Deploying Python on cPanel:

To deploy a Python application on your Python hosting, you will need to use the “Setup Python App” tool available on your cPanel account. This manager enables you to create, manage, and deploy a Python environment.

Please follow these steps:

Access your cPanel account

Navigate to the “Software” section and click on “Setup Python App”

Python cPanel

A new page will appear; click on Create Application to add a new application.

Python Application

You can now create and customize your application. You will have access to manage it afterward.

The two parameters “Application Root” and “Application” are required. Then, click on “Create”.

  • Python version: Select the Python version for your application.
  • Application Root: Define the folder where the source files of your application are located.
  • Application URL: Enter the domain name or URL where your application will be accessible.
  • Application Startup file: The file that starts your application. It is located in the Application Root folder and must follow the WSGI specification.
  • Application Entry Point: The function name in the WSGI file of the Application Startup file, which executes the application. Generally, this is Application.
  • Passenger log file: The destination of the log file generated by Phusion Passenger, the technology used to run a Python application.

Create Python

Once your application is created, additional options will be available for deeper configuration of your project.

  1. Destroy and Save: These options are used to delete the deployed application and save changes, respectively.
  2. Source: A command you need to run to enter your working environment via SSH or terminal.
  3. Stop App and Restart: Allow you to stop and restart the application (e.g., after modifications).
  4. If you didn’t configure these parameters previously, default settings are applied.
  5. Run pip Install: Allows you to install dependencies.
  6. Execute Python Script: Runs Python scripts.
  7. Add variable: Adds and modifies variables passed to the application.

Python Configuration

Articles Liés