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
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
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
Close
Hashes for django-react-components-0.1.1a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17d98ca7c1a25c78f252eb76188a0a171c2c2653976f704691377610a0bc2c70 |
|
MD5 | 704aa258a2a6448521dd036b17c7be09 |
|
BLAKE2b-256 | d5485657a652f85acf34256a780caa4485126c681e6a9158f94ea3fb4816ad0e |