I used godaddy for hosting this python app
- Login to your cpanel account
- Under
Software
clickSetup Python App
- Click on
CREATE APPLICATION
button
-
Start by selecting your
Python version
-
The
Application root
- path to where your folder is locatedeg. say your app
testhost/
is saved in/home/username/
then, writetesthost
-
Select the URL for your application
-
Application startup file
- main python file that starts the application. Here it isapp.py
-
Application Entry point
is -app
-
Click
CREATE
🚨🚨🚨🚨
The
app.py
code might have changed after the deployment since the home page will display
It works!
Python v3.7.8
So make sure you have the copy of the
app.py
code seperatley, and after you've successfully installed the packages, make sure you update theapp.py
code to the original app code.
-
After this, scroll below to
Configuration files
-
Here we can should add the configuration files necessary to install the modules for our application. I use
requriements.txt
file, so I'll typerequriements.txt
and clickAdd
. -
Now click
Run pip install
, it'll showrequriements.txt
on dropdown option and click that. -
After the module is successfully installed, Go to
Python
section at the top and clickRESTART
.
🎉 Congratulations 🎉 You've deployed a Python app in Cpanel