Django hosting
Python web framework. Deploy to a dedicated VPS in seconds — database auto-created, SSL installed, firewall locked down from the first boot.
Python 3.11 – 3.13
Versions
SQLite / PostgreSQL / MySQL
Database
Python
Category
What is Django?
Django is a high-level Python web framework for building secure, database-driven web applications quickly. It includes an ORM, migrations, an admin interface, authentication, forms and templating out of the box.
Django follows a "batteries included" approach: most things a web application needs are part of the framework, and the wider ecosystem adds REST APIs, background jobs, search and more.
SharkCluster creates a Python virtual environment, installs Django, Django REST framework, django-cors-headers and Gunicorn, starts a new Django project and runs the first migrations. Gunicorn serves the project behind nginx or Apache and PM2 keeps it running after crashes and reboots.
You can also add a React frontend built with Vite. The web server then serves the React build as the site and forwards /api/ and /admin/ to Django.
Quick facts
- Version
- Python 3.11 – 3.13
- Database
- SQLite / PostgreSQL / MySQL
- Category
- Python
- SSL included
- Firewall locked
- DB auto-created
- Live in minutes
Why Django on SharkCluster?
Ready-to-code project
A working Django project with migrations applied, so you can start adding apps and models immediately or replace it with your own code.
REST APIs included
Django REST framework and django-cors-headers are installed, ready for API backends and single-page apps.
Production app server
Gunicorn runs the WSGI application with multiple workers instead of Django's development server.
Process management
PM2 restarts the app if it stops and starts it again after a server reboot.
Isolated dependencies
Each app has its own virtual environment, so different projects on one server can use different package versions.
Full-stack option
Add a React frontend served by the web server with API calls forwarded to Django on the same domain.
What you get with Django
Python virtual environment per app
Django, Django REST framework and django-cors-headers
Gunicorn WSGI server (2 workers)
PM2 process management and restart on reboot
Initial migrations applied
Optional React frontend built with Vite
nginx or Apache reverse proxy
Custom domain support
Free SSL certificate
SSH and SFTP access
Git deployment support
What Django is built for
Web applications
Database-driven sites and internal tools with Django's ORM, forms and admin.
REST APIs
API backends for mobile apps and single-page frontends with Django REST framework.
Admin dashboards
Use the built-in Django admin to manage data without building a custom UI.
Full-stack apps
Pair Django with a React frontend on the same domain.
SaaS products
Build multi-user products with authentication, permissions and a relational database.
Server specs for
Django
Not sure which plan to pick? The panel warns you before you deploy so you can choose the right size the first time.
- Minimum specs shown before deploy
- Panel blocks deploy if server is undersized
- Upgrade path available inside the panel
- Python
- Python 3.11, 3.12 or 3.13.
- Django
- The current Django release from PyPI at install time.
- Database
- SQLite to start; PostgreSQL or MySQL recommended for production.
- Memory
- 1 GB RAM minimum; 2 GB+ with a React frontend build or heavier workloads.
- CPU
- 1 vCPU minimum; 2+ vCPU for production traffic.
- Storage
- 10 GB+ SSD.
How Django fits together
Domain
Your domain or subdomain points to the SharkCluster server.
Web server
nginx or Apache forwards requests to Gunicorn and, with React, serves the frontend build.
Gunicorn
Runs the Django WSGI application (config.wsgi) on port 8000 with two workers.
PM2
Keeps the Gunicorn process running and restarts it after reboots.
Database
SQLite by default; connect PostgreSQL or MySQL in settings.py for production.
React frontend (optional)
A Vite build in frontend/dist, served as static files.
After your Django deploy
- 1
Create a Django application
Select Django in the SharkCluster panel and choose the Python version.
- 2
Choose a frontend
Optionally add a React frontend that is built and served on the same domain.
- 3
Connect your domain
Point your domain to the server and enable SSL.
- 4
Open the project
Connect over SSH or SFTP. The Django project is in htdocs/backend and the virtual environment in htdocs/backend/venv.
- 5
Create a superuser
Run manage.py createsuperuser to log in to the Django admin.
- 6
Deploy your code
Replace the starter project with your own code or add Django apps to it, then restart the PM2 process.
Ship Django your way
Install Python
Python, venv, pip and build tools are installed, plus the selected Python version where available.
Create the virtual environment
A fresh virtual environment is created in htdocs/backend/venv.
Install packages
Django, djangorestframework, django-cors-headers and gunicorn are installed with pip.
Start the project
django-admin startproject config creates the project and migrate applies the initial migrations.
Run Gunicorn
PM2 starts Gunicorn as <app>-django, bound to port 8000 with two workers.
Configure the web server
nginx or Apache forwards traffic to Gunicorn, or serves React and forwards /api/ and /admin/.
Keeping Django fast
Tune Gunicorn workers
A common starting point is (2 × CPU cores) + 1 workers; adjust for memory.
Use PostgreSQL
Move from SQLite to PostgreSQL for concurrent writes and larger datasets.
Serve static files from the web server
Run collectstatic and let nginx or Apache serve STATIC_ROOT directly.
Cache
Use Django's cache framework with Redis for expensive queries and views.
Optimize queries
Use select_related and prefetch_related to avoid N+1 queries.
Before you go live
Gunicorn process is running in PM2
Migrations are applied
Domain DNS points to the server
SSL is enabled
Superuser is created
Static files are collected and served
ALLOWED_HOSTS lists your domains
DEBUG is False in production
Ready your Django for launch
Set DEBUG = False
Set ALLOWED_HOSTS to your real domains
Move SECRET_KEY to an environment variable
Use PostgreSQL or MySQL instead of SQLite
Run python manage.py check --deploy
Configure STATIC_ROOT and run collectstatic
Set up database backups
Monitor the PM2 process and logs
Working with Django
Activate the virtual environment
Run from the application folder before using pip or manage.py.
cd htdocs/backend && source venv/bin/activateRun migrations
Apply database migrations.
python manage.py migrateCreate a superuser
Create an account for the Django admin.
python manage.py createsuperuserCollect static files
Copy static files to STATIC_ROOT.
python manage.py collectstatic --no-inputCheck production settings
List settings that should be changed before going live.
python manage.py check --deployRestart the app
Reload Gunicorn after code or dependency changes.
pm2 restart <app>-djangoCommon Django issues & fixes
502 Bad Gateway
- Cause
- Gunicorn is not running or failed to import the project.
- Solution
- Run pm2 logs <app>-django to see the error, fix it and restart the process.
DisallowedHost error
- Cause
- The domain is not in ALLOWED_HOSTS.
- Solution
- Add the domain to ALLOWED_HOSTS in config/settings.py and restart the app.
CSS and images missing in the admin
- Cause
- Static files are not collected or not served when DEBUG is False.
- Solution
- Set STATIC_ROOT, run collectstatic and serve that folder from the web server.
API routes return 404 with the React frontend
- Cause
- With nginx, requests to /api/... reach Django without the /api prefix.
- Solution
- Define the API URLs in Django without the /api prefix, or change the nginx proxy_pass so the prefix is kept.
ModuleNotFoundError
- Cause
- A package was installed outside the app's virtual environment.
- Solution
- Install it with venv/bin/pip install and restart the PM2 process.
Hardened before your first request
Every deploy is locked down from boot — closed firewall, valid SSL, and restricted access by default.
Set DEBUG = False in production.
Replace the starter ALLOWED_HOSTS = ['*'] with your real domains.
Keep SECRET_KEY out of version control.
Restrict CORS to the origins that need it.
Keep Django and dependencies updated.
Use HTTPS and enable secure cookie settings.
Run manage.py check --deploy before each release.
The data layer behind Django
SQLite to start
The starter project uses Django's default SQLite database, which is fine for development and small apps.
PostgreSQL or MySQL for production
Change DATABASES in settings.py and install the driver (psycopg or mysqlclient) in the virtual environment.
Migrations
Run manage.py migrate after every deployment that changes models.
Django environment configuration
Settings module
The project settings are in htdocs/backend/config/settings.py.
Secrets
Read SECRET_KEY, database passwords and API keys from environment variables or a .env file.
Allowed hosts
The starter project allows all hosts; set ALLOWED_HOSTS to your domains before going live.
A safe Django upgrade path
- 1
Back up the database
Take a backup before upgrading Django or running new migrations.
- 2
Read the release notes
Check Django's release notes and deprecation timeline.
- 3
Upgrade in the virtual environment
Run venv/bin/pip install -U django and test locally or on staging first.
- 4
Migrate and restart
Run migrations, then restart the PM2 process.
Take a snapshot before every upgrade so a bad release can be rolled back in minutes.
We manage the server, you own the store
SharkCluster manages
- VPS infrastructure
- Python runtime
- Gunicorn process in PM2
- Web server
- SSL
- Firewall
- Backups where enabled
You manage
- Django code and apps
- Settings and secrets
- Python dependencies
- Database schema and migrations
- Static and media files
- Django upgrades
Everything below the application line — from nginx to backups — is infrastructure. Your code, content and store configuration are always yours, and you keep full SSH and root access.
Frequently Asked Questions
The questions we hear most from people deploying Django on SharkCluster.
Contact supportA Python virtual environment with Django, Django REST framework, django-cors-headers and Gunicorn, a new Django project with migrations applied, and a PM2 process that runs Gunicorn behind nginx or Apache.
Yes. Replace the starter project in htdocs/backend with your code, install your requirements in the virtual environment, run migrations and restart the PM2 process.
The starter project uses SQLite. For production, connect PostgreSQL or MySQL in settings.py.
Yes. Choose React when creating the app. The React build is served as the site and /api/ and /admin/ are forwarded to Django.
The Python app is a general Python environment. The Django app sets up a ready Django project with Gunicorn and PM2.
Run pm2 restart <app>-django, where <app> is your application name.
From deploy to live in minutes
Stack configured
Runtime, process manager and config files set up for you.
SQLite / PostgreSQL / MySQL wired
Database created with a user and credentials in your config.
SSL + firewall
Free Let's Encrypt certificate and closed-by-default UFW rules.
Deploy anytime
Push with Git, or use the built-in file manager and ZIP upload.
Other applications you can deploy
How do you start
with SharkCluster?
To start with SharkCluster, create an account and your first server on DigitalOcean, Contabo or OVHcloud — no credit card or lock-in contract is needed. Every account includes free self-hosted business apps, free local backups, unlimited migrations and a dedicated DevOps manager.