ggds-django
The Ghana Government Design System (GGDS) for Django: the page parts as template tags, a form renderer that turns any Django form into GGDS markup with correct error handling, the GGDS styles, themes and script as static files, and GGDS colours and header for Django admin. Django 5.0 or later. Works with Wagtail and other Django-based CMSs.
Documentation: ghana-gds.github.io/ggds · Use it with Django · Versions and support
Set up
INSTALLED_APPS = [..., "django.contrib.staticfiles", "ggds_django"]
FORM_RENDERER = "ggds_django.forms.GGDSFormRenderer" # every form in GGDS markup
TEMPLATES = [{..., "OPTIONS": {"context_processors": [..., "django.template.context_processors.request"]}}]
To use GGDS for some forms only, leave FORM_RENDERER out and add GGDSFormMixin to those forms.
A page
{% load ggds %}<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% ggds_error_title form "Make a complaint" %} | Example Agency</title>
{% ggds_assets theme="nca" %}
</head>
<body>
{% ggds_skip_link %}
{% ggds_banner short_name="NCA" host="nca.org.gh" official=is_official %}
{% ggds_header name="National Communications Authority" nav=nav %}
<main id="main" tabindex="-1" class="ggds-container ggds-main">
{% ggds_breadcrumbs crumbs %}
<h1>Make a complaint</h1>
<form method="post">{% csrf_token %}
{{ form }}
<button class="ggds-button">Send complaint</button>
</form>
</main>
{% ggds_footer name="National Communications Authority" sections=sections links=footer_links %}
{% ggds_tab_bar tabs %}
</body>
</html>
Links are dicts ({"label": "Services", "href": "/services/"}) or ("Services", "/services/") pairs. The header
marks the section the page's address is in; the tab bar marks the current tab.
Forms
With the renderer, {{ form }} shows an error summary after a failed submit (focused on load by the GGDS
script, each item linking to its field, a radio group's to its first option), then every field:
| Django widget | GGDS markup |
|---|---|
| Text, email, number, date… | ggds-field with label, hint (help_text), error and ggds-input |
Textarea, Select, FileInput |
the same with ggds-textarea, ggds-select, ggds-file-upload |
RadioSelect, CheckboxSelectMultiple |
a ggds-fieldset with a legend and ggds-choices |
CheckboxInput |
a single ggds-choice |
GGDSDateField |
a ggds-fieldset with day, month and year boxes (ggds-date-input) |
Each control gets aria-describedby (hint, then error) and, with an error, aria-invalid="true". Errors start
with a hidden "Error:". Fields that are not required say "(optional)". Set autocomplete on personal details with
the widget's attrs. One field: {{ form.phone.as_field_group }}.
Dates people know
from ggds_django.forms import GGDSDateField
class ApplicationForm(forms.Form):
date_of_birth = GGDSDateField(label="What is your date of birth?", name="date of birth", birthday=True,
help_text="For example, 27 3 1990")
cleaned_data["date_of_birth"] is a datetime.date. The month can be typed as 3, 03, March or Mar. Errors use
name: "Enter date of birth", "Date of birth must include a year", "Year must include 4 numbers", "Date of birth
must be a real date", and with birthday=True or past=True, "Date of birth must be in the past". Only the boxes
with the problem are marked invalid, and the error summary links to the first of them. birthday=True also adds
autocomplete="bday-day" and so on.
Page parts
| Tag | |
|---|---|
{% ggds_assets theme="nca" %} |
Stylesheet, theme and optional script, in <head> |
{% ggds_skip_link %} |
First thing in <body> |
{% ggds_banner short_name host official %} |
Government website banner |
{% ggds_header name nav %} |
Logo or initials, name, sections, Search |
{% ggds_hero title purpose lede search_action tasks %} |
Homepage hero |
{% ggds_breadcrumbs crumbs %} |
Trail ending with the current page |
{% ggds_summary_list rows %} |
Check answers: rows of {"key", "value", "href"}; an empty value shows "Not given", and each Change link says what it changes. plain=True for no lines |
{% ggds_panel "Complaint sent" reference=ref %} |
Confirmation panel: the page's <h1> and the reference number |
{% ggds_pagination page_obj %} |
From Django's Paginator; keeps other query parameters |
{% ggds_footer name purpose address email phone sections links %} |
Footer |
{% ggds_tab_bar tabs %} |
Phone quick links: each tab has an icon |
{% ggds_error_summary form %} |
On its own, for forms you lay out yourself |
Everything else (buttons, notices, tags, cards, tables) is plain GGDS HTML: copy it from the documentation.
Django admin
Admin keeps its own layout but takes GGDS's colours, type, focus style and header (the flag-colour rule and the institution's logo or initials, name and country), from the GGDS tokens and your institution's theme:
INSTALLED_APPS = [..., "ggds_django", "ggds_django.admin_theme", "django.contrib.admin", ...] # above admin
GGDS_ADMIN = {
"theme": "nca", # a file in ggds/themes/, as for {% ggds_assets %}
"name": "National Communications Authority", # default: the admin site's site_header
"initials": "NCA", # or "logo_url" and "logo_alt"
"country": "Republic of Ghana", # the default; "" for none
}
It loads the tokens on their own (ggds/tokens.css), never the GGDS base styles, which would restyle admin's
elements. Admin is shown light only: the dark palette and the theme toggle are left out. manage.py check warns if
the app is below django.contrib.admin, a key is misspelt or the theme does not exist.
Content added after load
HTMX, fetch or a script that adds a GGDS menu or error summary should call initAll(element) from the GGDS script
(ggds/js/index.js) on the new content.
Develop
From the GGDS repository: pnpm run build copies the tokens, styles, themes, script and icons into the app;
pnpm run test:django runs the tests (including a check that the markup matches the GGDS documentation) and renders
an example site into the documentation build, where the accessibility tests check it.
Metadata
Release files for ggds-django 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ggds_django-0.2.0.tar.gz | 87.7 kB | With provenance | Details for ggds_django-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ggds_django-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ggds_django-0.2.0-py3-none-any.whl |
Total release size: 207.5 kB
Release files / ggds_django-0.2.0.tar.gz
| Download URL | ggds_django-0.2.0.tar.gz |
|---|---|
| Size | 87.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d85a5cfa4815cf3dd118c959cde129b2a34c0de111f7a46bd4c2ac63f67bf1a7
|
|
BLAKE2b-256 checksum How to use checksums |
4ea8ba35d4a569a8a433a888431a67d6b418392d0077b0215b65fcf94c682aa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / ggds_django-0.2.0-py3-none-any.whl
| Download URL | ggds_django-0.2.0-py3-none-any.whl |
|---|---|
| Size | 119.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7009b77695bd38d319458faf2719e793b0496efa2fdbf6053ee0f437da6a978
|
|
BLAKE2b-256 checksum How to use checksums |
3fda542a657f60b764f3c390fdd52bae45db55d452de1a7f1037ea3e4264fc22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for ggds-django 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ggds_django-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.