Python Applications Print

  • 0

Python Applications

cPanel allows you to run Python applications. This guide will outline the steps needed to set up and manage a Python app on your cPanel.

Steps to Run a Python Application on cPanel:

  1. Log into cPanel: Begin by logging into your cPanel account.

  2. Set Up the Application:

    • Click on Setup Python App.
    • Then, select Create Application to open the configuration form.

  1. Configure Application Details:

    • Python Version: Choose the appropriate Python version for your application.
    • Application Root: Specify the folder where your application files are located.
    • Application URL: Enter the URL, including the domain, where the application will be accessible.

  • Application Startup File (Optional): If desired, specify a startup file. If you skip this, cPanel will automatically create a passenger_wsgi.py file as the default startup file.

  • Application Entry Point (Optional): Set the entry point for the application, if needed. By default, cPanel will create a generic application object for you. For Django, simply enter application in this field.
  1. Specify Additional Settings:

    • Environment Variables: Set environment variables if necessary by clicking Add Variable, then entering the variable’s name and value.
    • Click Done to save these settings.
  2. Create the Application: Once all fields are completed, click Create. cPanel will generate the Python environment and complete the app setup.

Using SSH for Application Management

To further develop or manage your Python app:

  • Connect with SSH: Link your account to SSH.

  • Enter the Virtual Environment: Use the command below, replacing version, application, and username with your specific details.

     
    source /home/username/virtualenv/application/version/bin/activate && cd /home/username/application

Managing the Application in cPanel

From within cPanel, you can control the application's state:

  • Stop App: Halt the application.
  • Restart: Restart the application.
  • Destroy: Permanently remove the application from cPanel.

By following these steps, you can easily set up, run, and manage a Python application within your cPanel environment.


Was this answer helpful?

« Back