Skip to main content

use create react app with django

Project description

django-create-react-app

This app is a Django app that helps to integrating the integrate the React that has been added in your Project through create React App

Detailed documentation is in the "docs" directory.

Quick start

Install

pip install django-create-react-app

  1. Add "create_react_app" to your INSTALLED_APPS setting like this::
    INSTALLED_APPS = [
        ...
        'create_react_app',
    ]

  1. Add create react app configuration into your settings::
    CREATE_REACT_APP = {
        'DEFAULT': {
            'BUNDLE_DIR_NAME': '<path to bundle folder>',
            'FRONT_END_SERVER': "http://localhost:3000/",
            'is_dev': False,
        }
    }
  1. Use it in your templates ::
{% load react_bundle_loader %}

<html>
  <head>
    {% render_bundle_css  %}
  </head>
  <body>
    ....
     {% render_bundle_js %}
  </body>
</head>
    

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-create-react-app-0.7.1.tar.gz (4.4 kB view hashes)

Uploaded Source

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