DjangoCon Europe 2023

Best of both worlds: Next.js ❤️ Wagtail
2023-05-31 , East Drawing Room

Fully static sites have clear benefits – and limitations. Rather than going fully static, let’s try using Next.js in combination with a Django/Wagtail API backend to make the most of both platforms!


In the JavaScript world, a new breed of frameworks are reinventing how websites are built and hosted. With Next.js, we can create sites that are both static and dynamic across different routes, rendered client-side and server-side, all with one framework.

We don’t have to switch over fully to JavaScript to benefit from those innovations. We’ll combine Next.js with Wagtail, a tried-and-tested CMS based on Django. We’ll get the best of both worlds: the delight of Python in the backend for business logic, and the advanced dynamic UIs powered by React.

We will cover:

  • Initial project setup: what Next.js and Wagtail are, and how to set them up
  • Connecting Next.js with the backend, via a GraphQL API
  • Implementing common website requirements with this architecture
  • Deployment!

Aside from an initial introduction, all steps of the workshop will be hands-on. We expect attendees to come with Node and Python installed on their system, and already have experience with Django and JavaScript. No pre-existing knowledge required for Next.js, React, Wagtail, GraphQL.

I’m a Wagtail developer and core team member working at Torchbox in the UK.

Back in 2019, I participated in Google Summer of Code with Django, during which I implemented the cross-database JSONField that became available in Django 3.1. Now, I work as a Developer at Torchbox, building new features and improvements to the Django-based Wagtail CMS and its ecosystem.

Outside of the Django world, I maintain my project giscus, a comment system powered by GitHub Discussions. You can find me @laymonage on GitHub, Twitter, and other sites.