This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.
To my grandfather, Valentino. I will always miss you.
If you’re reading this, I’m glad! It means you are interested in Django, one of the most powerful and flexible web frameworks out there.
When I discovered Django years ago, I realized I could make perfectly working prototypes faster than with any other web framework; prototypes that later would become robust, rock-solid web applications.
These days, with JavaScript all the rage, the temptation to jump on the JavaScript-full-stack bandwagon is strong, and sometimes this tendency makes beginners think that everything must be built with JavaScript. It shouldn’t. Even if I work primarily with JavaScript, Django is still my safe harbor for building stuff quickly.
In Chapters 1, 2, and 3, we introduce the terminology, what makes a decoupled architecture, how modern JavaScript is supposed to work in Django, and how the Django REST framework can help you build REST APIs.
In Chapter 4, we discuss the advantages and drawbacks of a decoupled architecture.
In Chapters 5 and 6, we begin to build a Django project with the Django REST framework and Vue.js to show how Vue can work from within Django templates.
In Chapter 7, we discuss security for REST APIs, and deployment of our Django/Vue.js project.
In Chapter 8, we move to React and Next.js to show how such a framework can be paired with Django. We cover Next.js basics and data fetching.
Chapter 9 covers testing, both for the REST API and for the JavaScript frontend.
Chapter 10 covers authentication for decoupled setups and shows you how to use session-based authentication for single-page apps with the help of NGINX.
Finally, in Chapters 11 and 12, we cover GraphQL in Django, with a look at running Django asynchronously.
All the system commands presented in this book assume that the reader is using a Linux or MacOS system. As for the prerequisites, a basic knowledge of TypeScript and modern frontend libraries is expected.
Have fun!
This book is the product of my love for Django and its community.
I’d also like to express my gratitude to the Italian Python community in particular, one of the most welcoming out there!
is a freelance consultant with many years of experience in the IT industry. He spent the last several years as a frontend consultant, providing advice and help, coaching, and training on JavaScript and React. He worked as an instructor for many training agencies around the country, running in-person workshops and creating learning paths for aspiring developers. Author of The Little JavaScript Book, he loves to share his knowledge on his blog, with his tutorials reaching over 100k monthly visits. An avid Django user, he is active in the Python community as a speaker and as a coach for Django Girls.
is a software engineer specializing in building web apps with Python and Django, which he has been doing professionally since 2014. He works as a staff engineer, leading the backend team, which develops the GraphQL API. He has spoken at several tech conferences, including GraphQL Summit and PyCon Korea, and his main topics of interest are open-source, Python, and GraphQL. In his free time, he is a runner, musician, and traveler. He is based in Wrocław, Poland.