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 For Django, point it to your project’s
app.py with app = Flask(__name__), the startup file can be just: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.
After changing your code
Upload the changed files, run Run Pip Install again ifrequirements.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.