This article describes how to use the Python Selector in cPanel to create a Python application that uses a specific Python version. Additionally, you can use a virtual environment to develop the application further.
To create a new Python application that uses a specific Python version, follow these steps:
If you are using the Paper Lantern theme, in the SOFTWARE section of the cPanel home page, click Setup Python App:
Click CREATE APPLICATION:
The application form appears:
In the Application startup file text box, you can optionally specify the startup file for the application.
In the Application Entry point text box, you can optionally specify the callable object for the application.
In the Passenger log file text box, you can optionally specify a log file for the application.
In the Configuration files section, you can manage and install modules for the application:
In the top right corner of the page, click CREATE:
cPanel creates the application and sets up the Python environment.
To work inside the newly created environment, connect to your account using SSH, and then type the following command. Replace username, application, and version with the actual values as shown at the top of the page, next to Enter to the virtual environment. To enter to virtual environment, run the command:
source /home/username/virtualenv/application/version/bin/activate && cd /home/username/application
You can now install modules or use other commands to develop the Python application further. Additionally, you can control the application's running state from cPanel:
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.