Skip to main content

A module for Django that allows to build pattern libraries for your projects.

Project description

django-pattern-library

PyPI PyPI downloads Build status

UI pattern libraries for Django templates. Try our online demo.

Screenshot of the pattern library UI, with navigation, pattern rendering, and configuration

Features

This package automates the maintenance of UI pattern libraries or styleguides for Django projects, and allows developers to experiment with Django templates without having to create Django views and models.

  • Create reusable patterns by creating Django templates files as usual.
  • All patterns automatically show up in the pattern library’s interface.
  • Define data as YAML files for the templates to render with the relevant Django context.
  • Override Django templates tags as needed to mock the template’s dependencies.
  • Document your patterns with Markdown.

Why you need this

Pattern libraries will change your workflow for the better:

  • They help separate concerns, both in code, and between members of a development team.
  • If needed, they make it possible for UI development to happen before models and views are created.
  • They encourage code reuse – defining independent UI components, that can be reused across apps, or ported to other projects.
  • It makes it much simpler to test UI components – no need to figure out where they’re used across a site or app.

Learn more by watching our presentation – Reusable UI components: A journey from React to Wagtail.

Online demo

The pattern library is dependent on Django for rendering – but also supports exporting as a static site if needed. Try out our online demo:

Documentation

Documentation is available at torchbox.github.io/django-pattern-library, with source files in the docs directory.

Contributing

See anything you like in here? Anything missing? We welcome all support, whether on bug reports, feature requests, code, design, reviews, tests, documentation, and more. Please have a look at our contribution guidelines.

If you want to set up the project on your own computer, the contribution guidelines also contain all of the setup commands.

Nightly builds

To try out the latest features before a release, we also create builds from every commit to main. Note we make no guarantee as to the quality of those pre-releases, and the pre-releases are overwritten on every build so shouldn’t be relied on for reproducible builds. Download the latest django_pattern_library-0.0.0.dev0-py3-none-any.whl.

Credits

View the full list of contributors. BSD licensed.

Project logo from FxEmoji. Documentation website built with MkDocs, and hosted in GitHub Pages.

Project details


Download files

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

Source Distribution

django_pattern_library-1.0.1.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

django_pattern_library-1.0.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file django_pattern_library-1.0.1.tar.gz.

File metadata

  • Download URL: django_pattern_library-1.0.1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for django_pattern_library-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c44a5c1f0c76cd108518b287b1e47d96b7462dc711b503524978b0f6a235c82d
MD5 96f4e9222918fa92c470b2a5c1623bab
BLAKE2b-256 4472e878e14bb470ecd5ceb61074ae7d70a342917fcdd359a99846a976ad7263

See more details on using hashes here.

File details

Details for the file django_pattern_library-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_pattern_library-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efd51e09cd073143f7667bb16b1487389f10868db644f9becbd02f2bfe891fc6
MD5 77283b7e153829d3550ef3c66ff552e4
BLAKE2b-256 ee89484bc9beb42dffc370b8c03edeb574d898aaf70ebca96717c126eef58602

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page