Modern JavaScript for Django Developers
2021-06-03, 11:30–12:15, Main Room

Many Django developers are intimidated by "modern" JavaScript, and those that aren't tend to throw away much of Django and use it only as an API for a standalone JavaScript front end.

This talk will outline the options for using Django with a modern framework like React or Vue, and deep dive on everything you'd need to know to incorporate modern JavaScript into a Django project without giving up Django's View/Template system.

It will also highlight some of what you gain by embracing modern JavaScript.


The talk will include four high level parts.

Part 1 is a discussion of common Django / JavaScript architectures. These include:

  1. The most common "ad-hoc" approach, where JS just gets incrementally added to templates until you find yourself in a mess
  2. The "completely decoupled" JS front-end and Django-API back end, which is popular, but complex and unfamiliar to pure Django developers.
  3. A "hybrid architecture", that combines modern JS with familiarity of working in Django.

Part 2 will focus on the fundamentals of JS tooling - a prerequisite to working with modern JavaScript. I'll start with explaining why it's so frustrating and confusing trying to add React to a Django project. Then introduce the concept of a JavaScript toolchain. Why you need them and what they do. And finally do a quick overview of the most common JS toolchain: NPM, Webpack, and Babel, including what each does and the analogies in the Python world.

Part 3 brings it together with a Django example, deep diving into how you can add a JS toolchain to a DJango project and introduce a React application into a Django application without all the complexity of managing separate standalone front end.

Part 4 will briefly touch on some benefits of Modern JS, including using modern frameworks, dependency management, new features, extensions, ES6, React and JSX, Vue etc.

Video: https://www.youtube.com/watch?v=fyXEnQ8wBR0&ab_channel=DjangoConEurope

See also: Slides