Integrate the French government Design System into a Django app
Project description
Django-DSFR
Django-DSFR is a Django app to integrate the French government Design System (“Système de design de l’État français”).
This app was created as a part of Open Collectivités and is very much a work in progress. See the documentation (in French) for details.
Django-DSFR (partly) implements the version 1.10.1 of the DSFR.
Requirements
Tested with Python 3.7 to 3.11 and Django 3.2 to 4.2. Per vermin, it should work with Python >= 3.6, and it should work with old versions of Django too.
Quick start
Install with
pip install django-dsfr
.Add “widget_tweaks” and “dsfr” to INSTALLED_APPS in your settings.py like this, before the app you want to use it with:
INSTALLED_APPS = [ ... "widget_tweaks" "dsfr", <your_app> ]
In order to use forms and formsets, add to INSTALLED_APPS in your settings.py:
INSTALLED_APPS = [ ... "django.forms", "widget_tweaks", "crispy_forms", ]
Add the following info in the TEMPLATES section in your settings.py so that the choice forms work:
TEMPLATES = [ { [...] "DIRS": [ os.path.join(BASE_DIR, "dsfr/templates"), os.path.join(BASE_DIR, "templates"), ], }, ]
Add the following FORM_RENDERER in settings.py so that the choice forms work:
FORM_RENDERER = "django.forms.renderers.TemplatesSetting"
(Optional) Add the context processor to your settings.py and create an instance of “DsfrConfig” in the admin panel:
TEMPLATES = [ { [...] "OPTIONS": { "context_processors": [ [...] "dsfr.context_processors.site_config", ], }, }, ]
Include the tags in your base.html file (see example file at https://github.com/entrepreneur-interet-general/django-dsfr/blob/main/example_app/templates/example_app/base.html)
Start the development server and visit http://127.0.0.1:8000/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_dsfr-0.16.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97ea58f1f81c2969ee6675fb3719b948b965715266ec09c1f9a2dbccf914a78e |
|
MD5 | 81d64c83e6f69aa7360da1cadffa86f3 |
|
BLAKE2b-256 | f4d0d4d11194ae57bb69954ccc6f512e87789c7f4f0af945495fbdeb8cf01a7f |