# Wagtail — The Flexible Django Content Management System > Wagtail is an open-source CMS built on Django that gives developers full control over frontend design while providing editors with an intuitive page-editing interface. ## Install Save as a script file and run: # Wagtail — The Flexible Django Content Management System ## Quick Use ```bash pip install wagtail wagtail start mysite cd mysite python manage.py migrate python manage.py createsuperuser python manage.py runserver # Visit http://localhost:8000/admin/ ``` ## Introduction Wagtail is a CMS built on top of Django that separates content modeling from presentation. It gives developers freedom to build any frontend while providing content editors with a streamlined admin interface featuring inline editing, image management, and workflow approvals. ## What Wagtail Does - Provides a tree-based page model with customizable content types via Django models - Offers StreamField for flexible block-based content composition - Includes a built-in image library with focal-point cropping and renditions - Supports content workflows with moderation, revisions, and scheduled publishing - Delivers a fast search backend with Elasticsearch or database-level search ## Architecture Overview Wagtail extends Django's ORM to create a hierarchical page tree using django-treebeard. Each page type is a Django model subclass with fields exposed in the admin. StreamField stores structured content as JSON, rendered through block templates. The admin UI is a React-based SPA communicating with Django views. Media assets are managed through a pluggable storage backend compatible with S3 and local filesystems. ## Self-Hosting & Configuration - Install via pip and scaffold a project with `wagtail start` - Configure the database in Django settings (PostgreSQL recommended for production) - Set up media storage with django-storages for S3 or equivalent cloud storage - Enable Elasticsearch for full-text search by configuring WAGTAILSEARCH_BACKENDS - Deploy behind Gunicorn or uWSGI with Nginx as the reverse proxy ## Key Features - StreamField enables editors to compose pages from reusable content blocks - Built-in draft/publish workflow with multi-stage moderation support - Responsive image handling with automatic format conversion (WebP, AVIF) - Snippet system for reusable content fragments across pages - Full REST API and GraphQL support via wagtail-grapple for headless use ## Comparison with Similar Tools - **Django CMS** — More tightly coupled to frontend templates; Wagtail offers greater developer flexibility - **WordPress** — PHP-based with a larger plugin ecosystem; Wagtail leverages Django's Python stack - **Strapi** — Headless-first API CMS; Wagtail provides both traditional and headless modes - **Directus** — Database-wrapper approach; Wagtail uses Django ORM with explicit content models - **Payload CMS** — TypeScript/Next.js based; Wagtail targets Python/Django teams ## FAQ **Q: Can Wagtail be used as a headless CMS?** A: Yes. Wagtail includes a built-in REST API and supports GraphQL via plugins for fully headless architectures. **Q: Does Wagtail work with any Django project?** A: Yes. Wagtail can be added to an existing Django project as an app — it does not require starting from its project template. **Q: How does StreamField differ from rich text?** A: StreamField stores structured blocks (images, quotes, code, embeds) as typed JSON, giving precise control over layout and rendering. **Q: What databases does Wagtail support?** A: Any database Django supports — PostgreSQL, MySQL, SQLite. PostgreSQL is recommended for search and JSON field features. ## Sources - https://github.com/wagtail/wagtail - https://docs.wagtail.org --- Source: https://tokrepo.com/en/workflows/asset-160d7268 Author: Script Depot