Requirements (Before You Start)
Make sure your hosting supports:
- Python (via Setup Python App in cPanel)
- SSH access (optional but helpful)
- Passenger (usually enabled by default)
Step 1: Login to cPanel
- Go to your cPanel (e.g.
yourdomain.com/cpanel) - Enter your username & password
Step 2: Open “Setup Python App”
- Search for: Setup Python App
- Click it
This is where you create and manage your Django app.
Step 3: Create a New Python Application
Click Create Application and fill:
- Python version → Choose latest available (e.g. 3.10+)
-
Application root → e.g.
myapp -
Application URL →
yourdomain.com/or
yourdomain.com/myapp -
Application startup file →
passenger_wsgi.py -
Application Entry point →
application
Then click Create
Step 4: Activate Virtual Environment
After creation, cPanel will show something like:
Option A: Using Terminal (Recommended)
- Open Terminal in cPanel or SSH
- Run:
Step 5: Install Django
Inside the virtual environment:
You can also install your requirements:
Step 6: Upload Your Django Project
You have 2 options:
Option A: Upload ZIP
- Go to File Manager
- Upload your project ZIP
- Extract inside:
Option B: Git (Advanced)
Step 7: Configure passenger_wsgi.py
Edit:
Replace with:
import os
# Add your project path
sys.path.insert(0, os.path.dirname(__file__))
# Set Django settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'yourproject.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Replace:
with your actual Django project name
Step 8: Configure Django Settings
Open:
Update:
Static files (important):
Step 9: Run Migrations
In terminal:
Step 10: Collect Static Files
Type:
Step 11: Restart Application
Go back to:
Setup Python App → Restart
Step 12: Test Your App
Visit:
If everything is correct → ???? Your Django app is live!
Common Fixes (Very Important)
❌ Error: Module Not Found
Run:
❌ Error: Static Files Not Showing
Make sure:
collectstaticwas run- STATIC_ROOT is correct
❌ Error: 500 Internal Server Error
Check logs:
Bonus: Use MySQL Database
Instead of SQLite:
- Create DB in cPanel → MySQL Databases
- Install:
- Update
settings.py
Best Practices (For Production)
- Turn off debug:
- Use
.envfor secrets - Secure your app
