HostRight

Django hosting

How to Run Django with Database and Redis for Less Than $3/Month

Deploy Django with Python, MariaDB, Redis caching, SSL, Git, SSH, static files, migrations, email, cron jobs, and backups on affordable managed hosting.

Published 2026-07-30 · 8 min read

Django does not need a VPS for every project. A blog, internal tool, brochure site, or small application can run on managed Python hosting when the host provides a WSGI runtime, database access, file transfer, environment variables, and a reliable way to reload the application.

HostRight provides those pieces through HostRight Control Panel and Phusion Passenger. The complete Python workflow is documented in Deploy Python applications with HostRight Control Panel and Phusion Passenger. This article focuses on the Django-specific decisions.

Keep the project private

Create the project outside the domain's public directory:

apps/example-django/
├── manage.py
├── passenger_wsgi.py
├── requirements.txt
├── project/
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── staticfiles/

Use Git for repeatable deployment:

cd ~/apps
git clone git@github.com:example/example-django.git example-django
cd example-django

You can also use SFTP or FTP. SFTP is preferred for encrypted transfers.

Configure HostRight Control Panel

Open Extra Features → Setup Python App → Create Application. Set:

Application root: apps/example-django
Application startup file: passenger_wsgi.py
Application entry point: application

Create the startup file:

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from project.wsgi import application

Passenger imports this WSGI callable. It does not run Django's development server.

Install and configure

Activate the environment shown by HostRight Control Panel:

cd ~/apps/example-django
source ~/virtualenvs/example-django/bin/activate
python -m pip install -r requirements.txt

Configure the application environment:

DJANGO_SECRET_KEY=replace-with-a-random-secret
DJANGO_DEBUG=false
DJANGO_ALLOWED_HOSTS=example.com,www.example.com
DATABASE_URL=replace-with-your-database-connection

Keep secrets out of source control. In settings.py, configure allowed hosts, secure cookies, CSRF protection, database, email, and static files.

Migrate and collect static files

python manage.py check --deploy
python manage.py migrate
python manage.py collectstatic --noinput

Test login, forms, email, uploads, admin, and static assets. Take a backup before schema changes and major dependency upgrades.

Release changes

cd ~/apps/example-django
git pull --ff-only origin main
source ~/virtualenvs/example-django/bin/activate
python -m pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic --noinput

Reload the application in HostRight Control Panel after the release. If Passenger reports an import error, verify the application root, Python version, startup file, entry point, package name, and dependency environment.

Use the SSH guide for terminal access, the Redis guide for cache and sessions, and the backup guide before risky changes.