Nowadays, everything can be done through the Web. Ordering food, booking holidays, hailing taxis . . . you name it. Most banking transactions no longer require you to go to the bank. You can make most purchases online.
My intention when writing this book is to cover enough use cases from the real world, without being too focused on a specific business. If you are reading this book, it is because you want to equip yourself with the knowledge to build many of these popular systems.
This book approaches teaching in a very practical way. You will not find much theory in this book, not because it is not useful, but because I believe in understanding the theory by looking at how things work in practice. I am putting emphasis on the word “Practical” by having it in the book title, so be warned!
We are going to build an e-commerce presence for a fictitious company called BookTime, which sells books online. E-commerce is a good paradigm to use because you very likely have experienced it as a user, and it is also where much of my experience comes from.
We will build the online catalog, the checkout process, internal dashboards, integrations with distribution companies, and real-time components that will be used through a mobile application.
This book will put Django at the center of our attention, but it is not possible to do everything in Django. Django is part of a bigger ecosystem of tools, and if some of these are a better fit for our purpose, we will use those instead.
We will use Bootstrap, React, Webpack, and React Native in this book. These tools are needed to reach solutions that will improve the user experience, shorten our time to develop, and follow what most of the Django community does in practice.
We will also integrate Django with some common Django libraries managed by its community: Django-extensions, factory_boy, Django Debug Toolbar, Django-tables2, Django-filter, Django Rest Framework, and, most importantly, Django Channels.
Django Channels is a new piece in the Django ecosystem that allows us to solve a class of problems that standard Django does not solve well: event-driven programming. Event-driven programming is the best paradigm to use when a system has high input/output load, which goes beyond normal HTTP request/response traffic. Chat systems fit in this, because people do not talk by following a request/response pattern.
I encourage you to see these decisions as pragmatic, but not ultimate. Ultimately, you are free to use any libraries you want. I am also conscious that what might be a good decision for me is not necessarily good for you.
This book is for people who already have a basic understanding of Python and want to follow this journey of going from zero to have a good e-commerce platform. Chapters will start simple and build up complexity as you get toward the end of this book.
I hope that the journey we are going to go through will serve you well as a reference in the future when you implement your project in Django.
has been a freelance software engineer and DevOps specialist for over 15 years. With a background in computer science and an MSc in Business Psychology, he has worked in companies ranging from e-commerce companies to finance, medical, and banking companies. He started developing web applications with Python 1.5.2 on Red Hat systems and has been using Django since the first 1.x versions, more than 8 years ago. Federico now consults on technology strategy and tech teams with startups, and still is very hands-on with coding. He has open sourced a lot of code online, some of which is part of GNU Social. In his spare time, he enjoys playing drums and running. He can be contacted via https://federicomarani.me .
is a senior web developer and consultant who has worked with Django since version 0.9. He has used it to build robust applications for a wide range of clients, from high-growth startups to international charities, across a diverse set of domains, including supply-chain tracking, freelancer marketplaces, environmental campaigns, and even online karaoke. Steve lives with his young family in a hilly part of the UK, where he enjoys trail running. He can be contacted via https://www.stevejalim.co.uk .
3.139.107.241