Install a Python application
Note: Note: If you’re one of GuideIT Customers, you’ll only have to request it from our 24/7 technical Support, If you’re not Please follow these steps to install the Python WSGI web application on your website using cPanel.
Before you begin, make certain that your hosting provider installed the following EasyApache 4 RPMs on your server:
Install the application
To install an application, perform the following steps:
- Log in to the server via SSH as a cPanel user.
- Create the application’s directory, relative to your home directory. To do this, run the following command, where
directorynamerepresents the application’s directory:
3. Change to the application’s directory. To do this, run the following command, where directoryname represents the application’s directory:
4. Copy the application to your server.
5. Create the passenger_wsgi.py file. In this example, pythonapp represents your python application and MyApp represents an application function:
echo "from pythonapp import MyApp as application" > passenger_wsgi.py
6. Install the application’s dependencies. To do this, run the following command:
pip install --user -r requirements.txt
Test the application
After you install the application, we recommend that you confirm that it’s active.
1. Run the following command:
The output might resemble the following example:
<!DOCTYPE html> … <section class="main"> <h1>Hello world!</h1> Welcome to the example app. </section> </body> </html>
2. Open another terminal window and log in to the server via SSH as the same cPanel user.
3. Run the following command:
The output will resemble the following example:
Register the application
After you install the application, register it. To do this, use cPanel’s Application Manager interface (cPanel >> Home >> Software >> Application Manager). You can then access the application in a web browser with the following url: