Which Javascript framework should I use with Django?

I have written one view about this already on day 63 which takes a more philosophical about learning technogies. All that said however, when building a website with any amount of functionality, Javascript will feature somewhere. But the real question is what's the best Javascript thing to use with Django?

The answer is a decision tree (which I may create another day) of sorts. I personally start with a lot of questions, here are a selection:

  • Are you using Django templates or is the backend an API or is it both?
  • Do you have an existing team of frontend developers or plans for one?
  • Do you need to support multiple frontend environments (eg web, mobile, desktop, etc)
  • Are you still learning Django?
  • Do you have a particular technology you want to learn for this project?
  • Is this project for fun or for business?
  • Are you working in a team or working solo?
  • Is this an existing project or a fresh start?

Answers to those questions ought to reveal the best approach for a project. For example, working solo or in a small team that just requires a web presence, then I would start with just some Vanilla Javascript or small libraries like HTMX, AlpineJS or StimulusJS.

If you have a team of frontend devs, or you are supporting multiple frontend environments then an investment into a heavier framework such as React, Vue or Angular is more likely to worth the effort. When it comes to multiple platforms then you might even be considering different languages such as Rust and the Tauri framework which in turn can use the heavier JavaScript frameworks.

Finally if you are working with an existing codebase then the easiest thing is to follow existing conventions and only introduce new technologies in an incremental manner so either development doesn't grind to a halt or the performance is affected.