Skip to main content

A collection of tools that assist with loading and rendering React components

Project description

# Django React Components

Django React Components is a collection of tools that automate the loading and rendering of React components when used in
conjunction with django-react-compiler. This tool is currently in beta.

## Installation

Install Django React Components using pip:
```bash
$ pip install django-react-components
```
Add `django_react_components` to your `INSTALLED_APPS` in `settings.py`:
```python
INSTALLED_APPS = (
...,
'django_react_components',
)
```

You will also need to install three other dependencies:
- [`django-react-compiler`](https://github.com/zagaran/django-react-compiler): the JS counterpart to this
package, used to serve the React components for `django-react-components` to load into Django templates.
- [`django-webpack-loader`](https://github.com/owais/django-webpack-loader/): the Django dependency used to render the
runtime bundles required for React to run.
- [`webpack-bundle-tracker`](https://github.com/owais/webpack-bundle-tracker): the dependency used by Webpack to
generate stats to be consumed by `django-webpack-loader`.

## Usage

#### Rendering React Components

In your templates, you can render React components by using the `{% react_component %}` template tag.
```python
{% load react_component from django_react_components %}

{% react_component 'App' id='app' props=props %}
```

## Requirements

Python 3.4-3.7, Django 1.11-2.2


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-react-components-0.1.0a0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-react-components-0.1.0a0.tar.gz.

File metadata

  • Download URL: django-react-components-0.1.0a0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for django-react-components-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 248a35777dfcc7dbd7d022ccd49f456d25fa7c7ac890e47b0c95011eaa162b8a
MD5 c68e4bba44630e1e95d4c88d668bcc75
BLAKE2b-256 d52dccb26e870aae5d19f897d402145cf8f0e93ab38b86d7a3c66da06efb7deb

See more details on using hashes here.

File details

Details for the file django_react_components-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: django_react_components-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for django_react_components-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ede3ed4449d111f7f111bab9d2f551aee3b8791b61c8db7f938bc713d0577b96
MD5 7d5078c06ba9c0012990ddfd3b77fec5
BLAKE2b-256 a786c22380c33fa38d71420eb6bb5a068e3757fd812474c9aaf82de4eda5a27d

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