Skip to main content

django-webpack-dev-server

PyPI version codecov Requirements Status CI pre-commit.ci status Code style: black License MIT

Django Webpack Dev Server is a command line Django reusable app to setup configuration files for React. It uses webpack and webpack_dev_server to bundle your frontend code.

React+Django

Installation

Install using pip

pip install django-webpack-dev-server

Package Supports

  1. React (Javascript)
  2. React (Typescript)

Quick start

  1. Add 'django_webpack_dev_server' to your INSTALLED_APPS in settings.py like this:

        INSTALLED_APPS = [
            ...
            'django_webpack_dev_server',
        ]
    
  2. Default django app name is frontend and template is javascript. You can provide your name and template by running
    python manage.py generate react --app_name your_app_name --template (javascript/typescript)

  3. Run python manage.py generate react to create a django app with the default app_name and template.

  4. Add the new django app to your INSTALLED_APPS setting like in step 1.

  5. Add the path for the new django app in the urlpatterns of the project's urls.py like this:

    from django.urls import path, include
    
    path("", include("your_app_name.urls")),
    
  6. Run python manage.py runserver to start the django's development server.

  7. cd into the newly created django app and run npm start and go to (http://localhost:8080/).

  8. Run npm run build to create a production build of your frontend code.

  1. Demo Video of the Package

  2. Check out Tech with Tim's Youtube Playlist for a detailed explanation in building Django and React Full Stack App.

  3. Webpack Documentation

Contributions

If you find an issue or have a new feature then feel free to make a Pull Request. Your Contributions are always welcomed.

Running the Package in Development Mode

  1. You can run the package in development mode by setting the "SOFTWARE_ENVIRONMENT_MODE" environment variable equal to "development".

  2. Now you can load assets from your local system and the new changes can be tested.

License

This project is provided under the MIT License.

Metadata

Release files for django-webpack-dev-server 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-webpack-dev-server 1.0.0
File Interpreter ABI Platform
django_webpack_dev_server-1.0.0-py3-none-any.whl Python 3 none any Details

Release files / django_webpack_dev_server-1.0.0-py3-none-any.whl

Download URL django_webpack_dev_server-1.0.0-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19475408db665684ea06ba22af2c7f0607598c52637a5e8128e8239d46c6a386
BLAKE2b-256 checksum
How to use checksums
53a1b24b912930b1285d8fa0f952d5f5dd94408a1d23936af966d012f12855ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page