Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/asifpy/django-webpack-sample

Webpack with Django
https://github.com/asifpy/django-webpack-sample

Last synced: 6 days ago
JSON representation

Webpack with Django

Awesome Lists containing this project

README

        

# django-webpack-sample

This project demonstrates the usage of webpack to bundle all the static assets within the Django project. [Django webpack loader](https://github.com/ezhome/django-webpack-loader) consumes the output generated by webpack-bundle-tracker and lets you use the generated bundles in django.

## Installation and setup

- Install [pipenv](http://pipenv.readthedocs.io/en/latest/) globally.
- Install [webpack](https://webpack.js.org/guides/installation/#global-installation) globally using npm

```shell
$ git clone https://github.com/asifpy/django-webpack-sample.git
$ cd django-webpack-sample
$ pipenv install (to install python packages)
$ npm install (install node packages)
```

## Build project static assets
```
$ cd django-webpack-sample
$ webpack --config webpack.config.js
```
This should create bundle at `django-webpack-sample/django-webpack-sample/assets/dist/app-[hash].js` which further gets used in django templates