Skip to content

Instantly share code, notes, and snippets.

@pj8912
Last active July 12, 2024 05:23
Show Gist options
  • Save pj8912/d030bc0b6f1ad6f767e383df296f200f to your computer and use it in GitHub Desktop.
Save pj8912/d030bc0b6f1ad6f767e383df296f200f to your computer and use it in GitHub Desktop.
Deploy Python Webapp in Cpanel

Deploy Python in Cpanel

I used godaddy for hosting this python app

  • Login to your cpanel account
  • Under Software click Setup Python App

image

  • Click on CREATE APPLICATION button

image

  • Start by selecting your Python version

  • The Application root - path to where your folder is located

    eg. say your app testhost/ is saved in /home/username/ then, write testhost

  • Select the URL for your application

  • Application startup file - main python file that starts the application. Here it is app.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 the app.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 type requriements.txt and click Add.

  • Now click Run pip install, it'll show requriements.txt on dropdown option and click that.

  • After the module is successfully installed, Go to Python section at the top and click RESTART.

🎉 Congratulations 🎉 You've deployed a Python app in Cpanel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment