/django-webpack-boilerplate

Django + Webpack without glue plugins

Primary LanguagePython

Django + Webpack without any plugins to glue them together

This is a demo project for my blog post here.
It's deployed on Fly.io here.

Installation

  1. yarn install (or npm install)
  2. poetry install (or pip install -r requirements.txt)

Development workflow

Run the Django server (python manage.py runserver) and Webpack in another tab (yarn start).

For more convenience you can use a tool like Goreman to run Django and Webpack in a single terminal: goreman -f Procfile.dev start.

Production workflow

Compile assets first with yarn build, then use Django collectstatic: python manage.py collectstatic.

If you're running on Heroku this will happen automatically if you use both the Node.js and Python buildpacks.