Wagtail (Django) Installation and Setup

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Wagtail (Django) Installation and Setup
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Installation and Configuration of Wagtail (Django)

Wagtail requires Python 3.8+, Django 4.2+. For production, PostgreSQL, Redis (cache/queue), Gunicorn/uWSGI, Nginx.

Project Creation

pip install wagtail
wagtail start myproject
cd myproject
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

requirements.txt

# requirements/base.txt
wagtail>=5.2
django>=4.2
psycopg2-binary>=2.9
pillow>=10.0
django-storages[boto3]>=1.14
django-redis>=5.4
gunicorn>=21.0
whitenoise>=6.5
wagtailmetadata>=4.0
wagtail-color-panel>=1.4

# requirements/dev.txt
-r base.txt
django-debug-toolbar>=4.2
django-extensions>=3.2
factory-boy>=3.3

# requirements/production.txt
-r base.txt
sentry-sdk>=1.35

settings/production.py

from .base import *
import os

DEBUG = False
SECRET_KEY = os.environ['SECRET_KEY']

ALLOWED_HOSTS = [os.environ.get('DOMAIN', 'mysite.com')]

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME':     os.environ['DB_NAME'],
        'USER':     os.environ['DB_USER'],
        'PASSWORD': os.environ['DB_PASSWORD'],
        'HOST':     os.environ.get('DB_HOST', 'localhost'),
        'PORT':     os.environ.get('DB_PORT', '5432'),
        'CONN_MAX_AGE': 60,
    }
}

CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': os.environ.get('REDIS_URL', 'redis://localhost:6379/1'),
        'OPTIONS': {'CLIENT_CLASS': 'django_redis.client.DefaultClient'},
        'TIMEOUT': 3600,
    }
}

# Static files via WhiteNoise or S3
STORAGES = {
    'default': {
        'BACKEND': 'storages.backends.s3boto3.S3Boto3Storage',
    },
    'staticfiles': {
        'BACKEND': 'whitenoise.storage.CompressedManifestStaticFilesStorage',
    },
}

AWS_STORAGE_BUCKET_NAME = os.environ['AWS_BUCKET']
AWS_S3_REGION_NAME      = os.environ.get('AWS_REGION', 'eu-west-1')
AWS_S3_CUSTOM_DOMAIN    = os.environ.get('CDN_DOMAIN')

WAGTAILIMAGES_MAX_IMAGE_PIXELS = 128 * 1024 * 1024  # 128MP

Docker Compose

version: '3.8'
services:
  web:
    build: .
    command: gunicorn myproject.wsgi:application --bind 0.0.0.0:8000 --workers 3
    volumes:
      - .:/app
    env_file: .env
    depends_on:
      - db
      - redis

  db:
    image: postgres:15
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: myproject
      POSTGRES_USER: myproject
      POSTGRES_PASSWORD: secret

  redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./staticfiles:/var/www/static

volumes:
  postgres_data:
  redis_data:

Dockerfile

FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y libpq-dev gcc && rm -rf /var/lib/apt/lists/*
COPY requirements/production.txt .
RUN pip install --no-cache-dir -r production.txt
COPY . .
RUN python manage.py collectstatic --noinput
EXPOSE 8000

Management Commands

python manage.py migrate
python manage.py collectstatic
python manage.py rebuild_references_index    # relationships index
python manage.py wagtail_update_image_renditions  # recreate transformations
python manage.py search_garbage_collect      # search cleanup

Wagtail installation with PostgreSQL and S3 for production takes 4–8 hours.