Skip to content

Deploy Django App on Seenode | Django Hosting & Deployment Guide

This guide explains how to deploy your existing Django application to seenode. For a production-ready setup, we recommend using a PostgreSQL database and WhiteNoise to serve static files.

Before you begin, ensure you have:

  • A seenode account at cloud.seenode.com
  • Git configured on your machine
  • Existing Django project ready to deploy

For a production setup, add these packages to your requirements.txt:

requirements.txt
gunicorn
dj-database-url
psycopg2-binary # Or the appropriate adapter for your database
whitenoise

Update your settings.py for production deployment:

your_project/settings.py
import os
import dj_database_url
# Security settings
SECRET_KEY = os.environ.get('SECRET_KEY')
DEBUG = os.environ.get('DEBUG', 'False').lower() == 'true'
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',')
# Database configuration
DATABASES = {
'default': dj_database_url.config(conn_max_age=600, ssl_require=True)
}
# Static files with WhiteNoise
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware', # Add WhiteNoise
# ... other middleware
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

Create a build.sh script to streamline deployments:

build.sh
#!/usr/bin/env bash
# exit on error
set -o errexit
pip install -r requirements.txt
python manage.py collectstatic --no-input
python manage.py migrate

Make the script executable: chmod +x build.sh

  1. Push to Git

    Commit your project and push it to GitHub or GitLab.

  2. Create a Database (Optional)

    If your application needs a database, create a PostgreSQL Database from the seenode Dashboard. seenode also supports MySQL.

  3. Create a Web Service

    Create a new Web Service and connect your Django project’s Git repository. Configure your build and start commands: Build Command:

    ./build.sh
    Start Command:
    gunicorn your_project.wsgi --bind 0.0.0.0:${PORT:-80}

    Configure Build & Start: Port field
  4. Configure Environment Variables

    Navigate to the Environment tab and link your PostgreSQL database. seenode will automatically configure the DATABASE_URL. Configure your production environment variables, including SECRET_KEY and ALLOWED_HOSTS.

  5. Choose Pricing Tier

    Select your preferred instance size and create your service.

  6. Deploy

    Click Create Web Service and watch logs until your web service is live.

  7. Success

    Once complete, your Django application will be accessible via your service’s URL.

If you don’t have a Django project yet:

Option 1: Use our Template (Recommended)

Option 2: Create from Django Docs + seenode Setup

Follow the official Django documentation to create a new project, then return here for seenode-specific deployment steps.

seenode-Specific Setup Steps:

  1. Create Django project: django-admin startproject your_project
  2. Install production dependencies
  3. Configure settings for seenode
  4. Create build script

Now that your Django application is deployed, here are some things you might want to do next: