Guide: How to Deploy a Python (Django/Flask) App Print

  • 0

Guide: How to Deploy a Python (Django/Flask) App

Our Python Selector allows you to run modern frameworks like Django, Flask, or FastAPI with full control over your virtual environment.

1. Create the Environment

  1. Log in to cPanel and click Setup Python App.

  2. Click Create Application.

  3. Choose your Python Version (e.g., 3.11 or 3.12).

  4. Application root: Enter your project folder (e.g., my_flask_app).

  5. Application URL: Select your domain and leave the path blank for the root.

  6. Application startup file: For Flask, this is usually app.py. For Django, it is passenger_wsgi.py.

  7. Click Create.

2. Install Dependencies

  1. Open your cPanel File Manager and upload your requirements.txt into the application root folder.

  2. Go back to Setup Python App and click Edit on your application.

  3. In the Configuration files section, type requirements.txt and click Add.

  4. Click the Run Pip Install button.

3. Special Note for Django

If you are running Django, you must run your migrations. Copy the Command for entering to virtual environment at the top of the page, paste it into the cPanel Terminal, and run: python manage.py migrate


Was this answer helpful?

« Back