Skip to main content

Django DSGovBR 🏛️

PyPI version Python Versions Django Versions License: MIT

Pacote Django para integração com o Design System do Governo Federal Brasileiro (DS Gov.BR) no Django Admin e formulários Django.

📚 Documentação Oficial e Suíte: Para guias completos da suíte e outros temas da organização, acesse django-adminthemes.github.io.


Sobre

O django-dsgovbr facilita a implementação do Design System oficial do Governo Federal em projetos Django, garantindo conformidade visual, acessibilidade (WCAG) e padrão de usabilidade estabelecidos pelo gov.br.


Como Usar

1. Instalação via pip

pip install django-dsgovbr

2. Configuração no settings.py

Troque o 'django.contrib.admin' pelas apps do tema (o DSGovBrAdminConfig é o admin do Django com o site do tema) e adicione o compressor, que compila o SCSS do DS Gov.BR:

INSTALLED_APPS = [
    'dsgovbr.apps.DSGovBRConfig',
    'dsgovbr.apps.DSGovBrAdminConfig',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'compressor',
    # ...
]

TEMPLATES[0]['OPTIONS']['context_processors'] += ['dsgovbr.context_processors.layout_settings']

STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
]
COMPRESS_PRECOMPILERS = (('text/x-scss', 'django_libsass.SassCompiler'),)

Em produção com whitenoise (ou outro servidor de estáticos que só serve o que existe ao subir), use COMPRESS_OFFLINE = True e gere o CSS no build, depois do collectstatic: python manage.py compress.

O item "Sair" do usuário usa a rota logout do projeto ou, se ela não existir, admin:logout.

Links do rodapé do menu e da versão no rodapé da página (opcionais):

DSGOVBR_HEADER = {"menu": {"show": True, "footer": {"links": [{"label": "Ajuda", "url": "https://...", "target": "_blank"}]}}}
PROJECT_RELEASES_URL = "https://github.com/org/projeto/releases/tag/"  # + PROJECT_VERSION

Para o DSGovBrModelAdmin com importação/exportação, instale o extra: pip install django-dsgovbr[import-export].


Desenvolvimento Local (Workspace Privado)

Para contribuir com o projeto e rodar a suíte inteira localmente, utilize o ambiente orquestrado do workspace privado da organização Django Admin Themes:

# 1. Clone o repositório workspace privado
git clone git@github.com:django-adminthemes/workspace.git ~/projetos/PESSOAL/django-adminthemes/workspace
cd ~/projetos/PESSOAL/django-adminthemes/workspace

# 2. Inicialize o ambiente (clona repositórios e configura a CLI)
./dbkw setup

# 3. Suba o container do DSGovBR sandbox
dbkw launch dsgovbr

Para mais detalhes sobre os comandos CLI e o ambiente de desenvolvimento, veja a documentação do workspace/README.md.


📄 Licença

Distribuído sob a licença MIT. Veja LICENSE para mais detalhes.

Metadata

Release files for django-dsgovbr 6.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-dsgovbr 6.0.1
File Size Uploaded Provenance Actions
django_dsgovbr-6.0.1.tar.gz 218.5 kB With provenance Details for django_dsgovbr-6.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-dsgovbr 6.0.1
File Interpreter ABI Platform Actions
django_dsgovbr-6.0.1-py3-none-any.whl Python 3 none any Details for django_dsgovbr-6.0.1-py3-none-any.whl

Total release size: 541.0 kB

Release files / django_dsgovbr-6.0.1.tar.gz

Download URL django_dsgovbr-6.0.1.tar.gz
Size 218.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e0519ed73182f1097456d6aa07b292a433e15e9be1b33c7fa919ffb566561b0e
BLAKE2b-256 checksum
How to use checksums
62183c48cb042cde87c1a1840c254f269fc14f46ef33c3654ac155320d495da8
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 5, 2026.

Transparency log

Release files / django_dsgovbr-6.0.1-py3-none-any.whl

Download URL django_dsgovbr-6.0.1-py3-none-any.whl
Size 322.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82d25a135ee3329b44c3587a721a09f848fde335a0e61ff9a6bfe6df00952e40
BLAKE2b-256 checksum
How to use checksums
fd57b7518f81dc2dd14840fe983194f18b4c396b9eedb3b11f63092678c96349
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 5, 2026.

Transparency log

Security for django-dsgovbr 6.0.1

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.

Select from 2 files

Attestation for django_dsgovbr-6.0.1.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 5, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page