Django and React: Perfect Together

Jack McCloy

Wednesday 3:50 p.m.–4:40 p.m.
Audience level: Intermediate or Advanced

Description

We all love Django, but it's hard not to notice that front-end development is trending towards declarative JS frameworks like React. In this talk I'll cover (i) why this is happening, (ii) how Django and React fit together, and (iii) the hard parts / gotchas of using React in a Django project.

Abstract

React is a JavaScript library that makes it much easier to build dynamic single-page sites. I won't much dive into how React works, but the main advantage is that it allows you to build your view layer in a declarative way, and with reusable components.

We'll start with an overview how React works, with an eye towards how it's different from interpretive libraries like jQuery. This overview will center around how state is managed in React vs. jQuery, which is the biggest hurdle for many developers when they're learning React. So if you haven't quite wrapped your head around the difference between "2-way data binding" and "1-way data binding", or if you've heard someone talk about "data-down/actions-up", "flux", or "redux" and weren't quite sure what they were talking about, this will clear all that up.

Then we'll take a look at how you can integrate React into a Django project. We'll talk about how you might want to structure things if you're starting with a brand new project, but we'll also talk about ways you can start to take advantage of React's strengths even in projects that are already mature.

Finally, we'll talk about some of the challenging parts of working with React for the first time - how to handle front-end permissioning in React based on your back-end API, how to think about url routing when you literally have two routers, deployment, and the general confusion that goes along with using npm and webpack for the first time.


Buy your conference and tutorial tickets here! Tutorials are $150 per session.