Skip to main content

A package to reactify Django app.

Project description

Django Reactify is an app that allows developers to add and use React components in your Django app without using create-react-app.

Detailed documentation is in the “docs” directory.

Quick start

  1. Install the package via the following command:

    pip install django-reactify

  2. Add “reactify” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'reactify',
    ]
  3. Run the following command:

    Ensure that the templates directory exists in the specified app name.

    python manage.py reactify <app_name>

    > Replace the app name with the existing Django app you want to reactify.

    > This command does the following:

    • Creates barbel and webpack configuration files in the app’s root directory.

    • Creates package.json file with the scripts to run React development server.

    • Creates a react folder directory with the necessary files and subdirectories where you can add your react component files and redux actions and reducers.

    • Creates a react folder directory with the necessary files and subdirectories where you can add your react component files and redux actions and reducers.

    • Installs the basic npm development packages.

    • starts the react development server that listens on the changes made to the react components and compile a minimal js file that is rendered to the view.

  4. cd to the django app directory and run the following command:

    npm run dev

  5. Add the new view function to the views file to render the compiled version of the react app.

    def index(request):

    template_name = ‘<app_name>/index.html’

    return render(request, template_name)

  6. Add more React components to the react app’s component folder.

  7. Enjoy coding!

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-reactify-1.3.5.tar.gz (71.9 kB view details)

Uploaded Source

Built Distribution

django_reactify-1.3.5-py3-none-any.whl (75.8 kB view details)

Uploaded Python 3

File details

Details for the file django-reactify-1.3.5.tar.gz.

File metadata

  • Download URL: django-reactify-1.3.5.tar.gz
  • Upload date:
  • Size: 71.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django-reactify-1.3.5.tar.gz
Algorithm Hash digest
SHA256 acb689c388e0ceb3e9ef6da608fbb00bad6f83a0eaf6f5126af412da3ebbb7c1
MD5 b034f0f705f6154184fc945c94a65660
BLAKE2b-256 fbc5cc3fb5c84df83e0eaf1c468b53adb6a3a3b5ddc0b22abd608727e4be9b42

See more details on using hashes here.

File details

Details for the file django_reactify-1.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for django_reactify-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1696ac52442495f9e4008727241ed7a3c3248d35672641911d5cb36e125d4ba9
MD5 0f9861db3e5e937bf61f867b442c3064
BLAKE2b-256 ee09971a8656482ef35a27bd0ec3bca58b85c02640d791cbb356e0681cbf5214

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