Getting started · Let.com knowledge base

How to Create a Python App in cPanel

Updated 2024-08-222 min read

Hosting documentation. Account access is coming soon. Always use the server details and nameservers assigned to your own account.

1.To create a Python app in cPanel, you would start by logging into cPanel.

2. In the Software section click on "Setup Python App".
blobid0.png

blobid1.png

3. Click the "Create Application" button to configure the settings for your new app.

4. You can choose between versions of the Python language - either 2.7.18, 3.5.9, or 3.7.8 - by clicking on the blue dropdown arrow.

blobid2.png

5. Choose the Application URL and Application root directory where your Python files will live. Note, you cannot use public_html for the Application root directory, so it should be a new folder or an existing sub-directory.

6. You can add Environment variables before creating your application by clicking "Add Variable" near the bottom of the screen.

blobid3.png

Each variable must have a name and a value. In the example below, the name is x and the value is 5, so x=5 would be the variable created.

blobid4.png

Click "Done" to save any added environment variables.

 

7. Click Create when you are ready to create your Python app. The creation process may take a minute or two.

8. When you are finished you will be given a terminal command at the top of the screen similar to:

source /home/reselle1/virtualenv/app/2.7/bin/activate && cd /home/reselle1/app

blobid6.png

 

9. At this point you can cancel, stop, restart, or destroy your Python app from this screen.
blobid5.png

10. To enter the Python virtual environment, enter the terminal command into a Terminal within cPanel. To get there, click: blobid7.png near the top left of the screen then click: blobid8.png

11. Once you have entered the command similar to source /home/reselle1/virtualenv/app/2.7/bin/activate && cd /home/reselle1/app

you can just type the command: python  to be entered into a Python shell/interpreter to enter Python code.

blobid10.png

12. You can load your Python app in a web browser by going to http://yourapplicationurl.com/pythonfoldername

 

NOTE: Python app development is outside our scope of support. Like any development project, you would need to refer to Python documentation or your own developer for assistance debugging any applications. To learn more about Python you can go to: https://www.python.org/about/gettingstarted/

 

 

Did this point you in the right direction?

Talk to the Let.com team

Frequently asked questions

What you need to know.

Talk to our team

What do I configure when creating the Python application?

The guide uses Setup Python App in cPanel, where you choose an available Python version, application URL and application root. It also describes optional environment variables.

Can the application root be public_html itself?

The article says to use a new folder or existing subdirectory instead of public_html as the application root.

How do I enter the application’s virtual environment?

After creation, cPanel displays an activation command for that application. Use the command provided by your own application screen rather than the article’s example path or version.

Let.com

Coming soon.

Account sign-up, log-in and checkout are not available yet. You can explore our products and compare plans while we get everything ready.

Compare plans