Skip to main content
You can run Python web applications, such as a Flask or Django site, on HostCloud hosting. This guide shows you how to set one up in cPanel.

Create the application

1

Open Setup Python App

Log in to cPanel, type Setup Python App in the Search Tools box and open it.
2

Start a new app

Click Create Application.
3

Fill in the details

4

Create

Click Create. cPanel sets up the app, its folder and a private Python environment for it.

Upload your code and install packages

1

Upload your files

Upload your app’s files, including requirements.txt, to the application root folder. See Upload files with File Manager or FTP.
2

Connect your app to the startup file

Edit the startup file so it loads your app. For a Flask app saved as app.py with app = Flask(__name__), the startup file can be just:
For Django, point it to your project’s wsgi.py instead.
3

Install packages

Back in Setup Python App, edit your app. Under Configuration files, add requirements.txt and click Run Pip Install.
4

Restart the app

Click Restart, then open the application URL in your browser.
To run commands such as python manage.py migrate, copy the command shown at the top of your app’s page in Setup Python App. Paste it into cPanel’s Terminal to enter your app’s Python environment. See Use Terminal and SSH.

After changing your code

Upload the changed files, run Run Pip Install again if requirements.txt changed, then click Restart.

If the app shows an error

  • Check the log. Your app’s errors are written to a log file. Set a log file path on the app’s page in Setup Python App if one isn’t set, then open it in File Manager.
  • Check the startup file. Most first-time errors come from a wrong file name or entry point.
  • Restart after every change. The app keeps running the old code until you restart it.
Apps that run heavy background work around the clock, or need their own services such as Redis, may outgrow shared hosting. A HostCloud VPS gives you full control. See Connect to your Linux VPS with SSH.
Still stuck? Open a ticket with your app’s URL and any error shown on the Setup Python App page.