A Django app to setup configuration files for React in a Django Project.
Project description
django-webpack-dev-server
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.
Installation
Install using pip
pip install django-webpack-dev-server
Package Supports
- React (Javascript)
- React (Typescript)
Quick start
-
Add 'django_webpack_dev_server' to your INSTALLED_APPS in settings.py like this:
INSTALLED_APPS = [ ... 'django_webpack_dev_server', ]
-
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)
-
Run
python manage.py generate react
to create a django app with the default app_name and template. -
Add the new django app to your INSTALLED_APPS setting like in step 1.
-
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")),
-
Run
python manage.py runserver
to start the django's development server. -
cd
into the newly created django app and runnpm start
and go to (http://localhost:8080/). -
Run
npm run build
to create a production build of your frontend code.
Important Links
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
-
You can run the package in development mode by setting the "SOFTWARE_ENVIRONMENT_MODE" environment variable equal to "development".
-
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.
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
File details
Details for the file django-webpack-dev-server-0.0.16.tar.gz
.
File metadata
- Download URL: django-webpack-dev-server-0.0.16.tar.gz
- Upload date:
- Size: 17.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 522628632e8236b66c8d7fdfcbe5544dc2ca71612d832d53f7a50752cfdfe2cc |
|
MD5 | 55b8c358c0fbf574db90e8b955a45a01 |
|
BLAKE2b-256 | a880063cdeb93906a458f75fd46f3ec983db832eb7e40ab2af6ee05472b3e05e |