A template that uses webpack to compile frontend code into Django template and src files.
Before starting the instructions below, please make sure you have Node.js and Python installed. To check, type npm -v
and python --version
in your terminal window to check for Node.js and Python respectively.
-
Run
npm install
to install all npm dependencies. -
Run
num run watch
to watch files. -
(optional) Start a Python venv with
python -m venv env
. -
Run
pip install requirements.txt
to install all pip dependencies. -
Run
python manage.py runserver
to start the Django server. -
Visit
127.0.0.1:8000
to see the Django development server. Also visit the/test
endpoint to see a different view.
Webpack Concepts
Django documentation
HtmlWebpackPlugin
jantimon/html-webpack-plugin