- Tom Dekan
- Posts
- 💡Create a Django and React app with auto-generated Django types
💡Create a Django and React app with auto-generated Django types
Hi all. Here's a link to my latest guide - it's quite a technical one.
The guide uses Django Ninja (which is lovely and much better than Django REST framework in my opinion).
I've used Next.js extensively over the past year. I've concluded that Django is much better: it's simpler, and faster to develop with - from the start and later.
But Next.js does have a great feature over Django - type safety. This applies across the stack. This is really powerful and eliminates a whole class of bugs.
So, this guide attempts to add the very best part of Next.js in my opinion, which is type safety across the stack.
The magic: We auto-generate types for our front-end React client from the Django Ninja OpenAPI schema.
This lets us have a typed REST API from Django to React.
The guide is here: Create a Django and React app with shared, auto-generated types

A snippet from the guide: https://tomdekan.com/articles/typed-django-react
I'll be adding the video guide shortly (It's uploading to YouTube now).
Hope you're having a great week!
Tom