django-seo-suite¶
A lightweight, extensible SEO metadata layer for Django. One consistent way to
attach and render the SEO attributes a page needs (<title>, <h1>, meta
description, keywords, robots, canonical URL, hreflang alternates, JSON-LD
structured data, and Open Graph / Twitter cards) across models, class-based
views, and third-party models you cannot modify.
The problem it solves¶
A typical Django project accumulates SEO metadata in scattered, hard-to-maintain
places: hard-coded strings in base templates, inconsistent {% block title %}
overrides, ad-hoc og:* tags that drift out of sync with rel="canonical", and
JSON-LD blocks copy-pasted across views. There is rarely a single place to look
when a page renders the wrong title or a crawl audit reports mismatched
canonicals.
django-seo-suite gives you that single place. Every page resolves its metadata
through a multi-provider resolver that merges contributions from global
defaults, per-site defaults, admin-editable URL rules, model fields, and view
attributes, in a documented, predictable priority order. A single template tag
renders the result.
Key capabilities¶
| Capability | How |
|---|---|
| Title, h1, meta tags, robots | Model conventions or explicit view/model attributes |
| Canonical URL | get_absolute_url or explicit; absolutised via request or configured domain |
| Open Graph + Twitter cards | Auto-populated from page metadata; fully overridable |
| JSON-LD structured data | Declarative schema profiles on models and views |
| hreflang alternates | build_hreflang_alternates with Django's translate_url |
| Sitemaps | SeoSitemap keeps <loc> = canonical |
| Versioned robots.txt | Database-backed history; activate/rollback from the admin |
| Admin-editable overrides by URL | seo_suite.contrib.seopath |
| Admin-editable overrides for third-party models | seo_suite.contrib.seoobject |
Design principles¶
Minimal footprint. The core package ships a single migration (the versioned
robots.txt table) and does not require django.contrib.sites,
django.contrib.contenttypes, or any other optional Django app. The optional
contrib apps (seopath, seoobject) add their own migrations only when you
install them; the SEO metadata mixins are abstract and create tables only inside
your own apps.
One dependency. Django 4.2+. Python 3.10+.
Progressive. Start with a two-line change to a model and a single tag in your base template. Add admin-editable overrides, structured data, hreflang, and caching later as the project grows.
Built for extension. Providers, schema profiles, head renderers, and the resolver itself are pluggable through stable, versioned APIs.
Quick navigation¶
| Goal | Start here |
|---|---|
| Get it running | Installation |
| First working example | Quickstart |
| Blog posts / articles | Guide: Blog posts and articles |
| List / index pages | Guide: Listing pages |
| Detail views | Guide: Detail views |
| Model-less views | Guide: Model-less views |
| Third-party models | Guide: Third-party models (seoobject) |
| Admin-editable by URL | Guide: Path-based overrides (seopath) |
| JSON-LD structured data | Guide: JSON-LD structured data |
| Open Graph and social images | Guide: Open Graph and social images |
| hreflang and multilingual | Guide: hreflang and multilingual |
| Sitemaps | Guide: Sitemaps |
| Versioned robots.txt | Guide: robots.txt |
| Site-wide defaults | Guide: Site-wide defaults |
| Customising rendered output | Guide: Customising output |
| How resolution works | How resolution works |
| Full settings reference | Reference: Settings |
| Template tags | Reference: Template tags |
| SeoMetadata attributes | Reference: SeoMetadata |
| Extension points | Extending the suite |