Background
For many people, it is not easy to make Django work with modern frontend tech, such as ES6
, SCSS
.
If we check online, many blog posts and tutorials are from view of frontend (such as building Single-page application), which might not work very well if we want to put JS, CSS files in Django template.
What is more, popular Django boilerplate projects on Github (such as cookiecutter-django) are still using a little outdated frontend tech (gulp
workflow).
This is a PAIN, so I decide to help people solve it!
Why Webpack
-
Webpack
is the most popular bundle solution in the frontend community today, it has received 50k stars on Github. - It has a great ecosystem, many plugins, loaders. If we search
webpack
on npmjs.com, we can get 20k resulst. - If we do not need
React
,Vue
, we can still use Webpack to help us compileES6
,SCSS
and do many other things (Many people do not know that!) - With a proper config, Webpack can save time and let us build modern web application in quick way.
Benefits
- We can still use Django template syntax and HTML as we are familiar with
- We do not need DRY (Django REST framework) and similar frameworks to expose data through API.
- We do not need to implement JWT, but using Django
standard auth
. - We can write JS and SCSS in modern syntax, the code is more readable and easy to maintain.
- Code linter can help check JS and CSS code style.
- We can even develop in a flexible way, for example, we can use
React
orVue.js
to build some components in the web pages, and write other parts in Django template.
What is included:
- 7 blog posts which are all FREE
- An open source project on Github which help.
You can check Definite Guide to Django and Webpack to learn more about this tutorial series.