{"repo":"torchbox/storybook-django","free":true,"listed":false,"github":"https://github.com/torchbox/storybook-django","clone":"git clone https://github.com/torchbox/storybook-django.git","description":"Develop Django UI components in isolation, with Storybook","language":"JavaScript","stars":121,"topics":["storybook","storybook-addon","django","pattern-library","storyshots"],"license":"MIT","category":"ui-components","readme_excerpt":"Storybook for Django Storybook for Django is an experimental UI development environment for Django components. It allows you to implement, document, and test UI components in isolation from your Django views. How it works Server-side, this uses django-pattern-library to mock template context and template tags. Client-side, we use Storybook to create stories from our templates. Getting started Let’s get you set up. There are two requirements: 1. First, start by setting up django-pattern-library, v0.7.0 and up. Have a look at our demo settings.py as an example. 2. Then, set up Storybook. We expect storybook-django to work with any framework supported by Storybook, and provide built-in support for React (Vue in progress). Next, install our package: Middleware Add a middleware.js inside your Storybook configuration folder ( .storybook by default): This will forward pattern library API requests to Django. You may optionally add more API path patterns to apiPath to make other requests to your Django backend. Optional Webpack configuration This is optional but highly recommended. To leverage Storybook’s live-reloading and documentation capabilities, we need to configure it to load our templates. Edit your Storybook main.js file to customise the webpackFinal option: React usage Here is the most basic story for a Django template: Pattern uses a hard-coded endpoint of /pattern-library/api/v1/render-pattern by default. To change this, pass a different value. For example, If this is a ne","default_branch":null,"files":null,"tree":[],"storefront":"/r/torchbox","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/torchbox/storybook-django/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}