Webpack is a modern development method for frontend projects. Django is a common backend development framework for Python developers.
I believe that developing with Webpack can make Django development faster.
Why
webpack
can enable Django developers to use the React ecosystem, and it makes auto-complete and linting available in Django frontend development, especially with VSCode.
Django developers should integrate Webpack, similar to what Rails developers did. At 2024-07-05, Webpack has retired in Rails. They are using Hotwire now. For more details, you should read the Rails 7 blog.
What to Choose?
I tested two popular projects on GitHub.
The first one is django-react-boilerplate. It has high stars and ranks second.
However, as of 2024-07-05, it’s not ready. I will continue to track its progress. It is hard and complex to configure the {{ project_name }}
.
The second one is python-webpack-boilerplate.
It has a gradual process and a good learning curve. I spent just 5 minutes adding Webpack to my example project.
Discussion
There is still a long way to go.
- React has not been added to the example project.
- A production environment is needed to validate its availability.