Skip to main content

Django application to add 'django-crispy-forms' layout objects for the GOV.UK Design System.

Project description

A GOV.UK Design System template pack for django-crispy-forms, for simple and powerful form generation which is compliant with GDS usability and accessibility guidelines.

Requires Django 2.2 or later and django-crispy-forms 1.9 or later.

This template pack supports govuk-frontend 3.5 or later.


This is a minimal howto without options or details - see the crispy-forms-gds documentation for full instructions for installation and usage.

Install using pip:

pip install crispy-forms-gds

Add to installed apps, with settings to tell django-crispy-forms to use this theme:


Build a regular crispy form using layout objects from crispy_forms_gds:

from django import forms

from crispy_forms_gds.helper import FormHelper
from crispy_forms_gds.layout import Submit

class TextInputForm(forms.Form):

    name = forms.CharField(
        help_text="Your full name.",
            "required": "Enter your name as it appears on your passport"

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.add_input(Submit("submit", "Submit"))

Render the form in your templates as normal:

{% load crispy_forms_tags %}
{% crispy form %}

Open the page in your browser:



The template pack supports all the basic components listed in the GOV.UK Design System:


If you checkout the code from the repository, there is a Django site you can run to see the forms in action. You will need to install nvm first (to manage node versions), then build and run the demo with:

make serve

Further reading

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for crispy-forms-gds, version 0.2.2
Filename, size File type Python version Upload date Hashes
Filename, size crispy_forms_gds-0.2.2-py2.py3-none-any.whl (42.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size crispy-forms-gds-0.2.2.tar.gz (31.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page