Skip to main content

A Django app to create configuration files for frontend library like React.

Project description

django-webpack-dev-server

PyPI version Requirements Status Code style: black

Django Webpack Dev Server is a Django app to create configuration files for frontend such as React. It uses webpack and webpack_dev_server to bundle your frontend code.

Installation

Install using pip...

pip install django-webpack-dev-server

Supported Frontend Library

  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 configuration.

  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.

License

MIT

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-webpack-dev-server-0.0.15.tar.gz (15.7 kB view details)

Uploaded Source

File details

Details for the file django-webpack-dev-server-0.0.15.tar.gz.

File metadata

  • Download URL: django-webpack-dev-server-0.0.15.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.7

File hashes

Hashes for django-webpack-dev-server-0.0.15.tar.gz
Algorithm Hash digest
SHA256 b561a3bda477eac1d085eafd180466015aa1435755418490f74019fdcd33bfa0
MD5 e6745ea3b814636fd1155115ae448aeb
BLAKE2b-256 ca7051a4de61206aaa4d0b2e5d18e9a45fb978eef14b9303b1a79077ceaa75a2

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