Build four real-world Django apps and learn Django by doing. Create fully functional web applications with authentication, content management systems, payment processing, REST APIs, and more!
Purchase of the print or Kindle book includes a free eBook in PDF format.
Key FeaturesUpdated with Django 5 features, detailed app planning, improved tooling, and GPT prompts for extending projectsLearn Django essentials, including models, ORM, views, templates, URLs, forms, authentication, signals, and middlewareIntegrate JavaScript, PostgreSQL, Redis, Celery, Docker, and Memcached into your applicationsBook DescriptionIf you want to learn Django by doing, this book is for you.
Django 5 By Example is the fifth edition of the best-selling franchise that helps you build real-world web apps. This book will walk you through planning and creation, solving common problems, and implementing best practices using a step-by-step approach.
You’ll cover a wide range of web application development topics through four different a blog application, a social website, an e-commerce application, and an e-learning platform. Pick up what’s new in Django 5 as you build end-to-end Python web apps, follow detailed project plans, and understand the hows and whys of Django.
This is a practical and approachable book that will have you creating web apps quickly.
What you will learnUse different modules of the Django framework to solve specific problemsIntegrate third-party Django applications into your projectBuild complex web applications using Redis, Postgres, Celery/RabbitMQ, and MemcachedSet up a production environment for your projects with Docker ComposeBuild a RESTful API with Django Rest Framework (DRF)Implement advanced functionalities, such as full-text search engines, user activity streams, payment gateways, and recommendation enginesBuild real-time asynchronous (ASGI) apps with Django Channels and WebSocketsWho this book is forThis book is for readers with basic Python programming knowledge and programmers transitioning from other web frameworks who wish to learn Django by doing. If you already use Django, or have in the past, and want to learn best practices and integrate other technologies to scale your applications, then this book is for you too. This book will help you master the most relevant areas of the framework by building practical projects from scratch.
Some previous knowledge of HTML and JavaScript is assumed.
Table of ContentsBuilding a Blog ApplicationEnhancing Your Blog and Adding Social FeaturesExtending Your Blog ApplicationBuilding a Social WebsiteImplementing Social AuthenticationSharing Content on Your WebsiteTracking User ActionsBuilding an Online ShopManaging Payments and OrdersExtending Your ShopAdding Internationalization to Your ShopBuilding an E-Learning PlatformCreating a Content Management SystemRendering and Caching ContentBuilding an APIBuilding a Chat ServerGoing Live
Antonio Mele is a Professor of Finance and a Senior Chair with the Swiss Finance Institute in Lugano after a decade spent as a Professor of Finance at the London School of Economics & Political Science. He is also a Research Fellow for the Financial Economics program at the Center for Economic Policy Research (CEPR) in London, and holds a PhD in Economics from the University of Paris.
I was lucky enough to receive an early review copy of “Django 5 by Example” by Antonio Melé. I had already read his previous book “Django 4 by Example”, so I was able to compare both versions. Please note that this early copy only contains the first seven chapters of the book. I really enjoyed this book, as I preferred it to the books “Django for Beginners” and “Django for Professionals”, but that’s only my own preference. Anyway, I think that more topics of Django are covered in the current book. This new edition is using the latest release of Django, but its content has also been reviewed. The content is very similar to the previous edition and still contains the same four projects. However, the content is not identical of course and I’m sure that a lot of time has been dedicated to deliver an even better edition. I don’t expect the whole book to be much bigger than the previous one. However, it contains a lot of small enhancements. The Python version and all libraries used in the book and in the repository are up-to-date. As the book is about Django 5, it introduces its new major features (facet filters, simplified form field rendering, database-computed default values, …). Along the book, some explanations have been added about technical details, about the choices to implement features in a way or another. As in the previous edition, at the end of each chapter, the book lists its references to the officials Django documentation. That’s a nice idea from the author. I really appreciated the effort to explain at the beginning of each chapter what the reader should accomplish with the help of a functional overview. Each time, an explanation is given about what will be implemented in the project and how. You can also find more UML-like schemas of the models used in the different projects. This effort helps the reader to better understand what the code is about and what is expected from the application/project. At several places, instructions have been added to help the reader in the implementation of the projects. Some of the implementation steps, although quite obvious, were missing. This has now been fixed. The code is now closer to code that could be used in a production environment. Some concepts like environment variables and docker containers are introduced quite early in the book. The book has also been slightly restructured, as some paragraphs have been moved to better places. Each concept is brought in at the right moment. The code is now closer to the PEP-8 guidelines, which is a nice upgrade compared to previous versions. Finally, as this is a hot topic, the book also makes some references to AI and how the project could be enhanced with the help of AI, but that’s a task that is given to the user and to find out by himself/herself. This book should be a fit for beginners as for more experienced Django developers. Most of the Django topics are covered. If there is something missing, in my opinion, it’s the topic about testing. Is there a chance that testing will be covered in a future edition ? However, there are other books that deliver this mission. Enjoyable reading, with a lot of explanations through the implementation of four Django projects.
Earlier I had my hands on Blazor and React, but did not stop there, I also wanted to get known some web frameworks that have been around for a while. I was not disappointed, nor was I surprised - Django delivers and over-delivers! Programming in Django (I opted for a DigitalOcean droplet) I felt like I am driving a premium vehicle with a rich array of features a knob press away compared to some other Web Frameworks. Again, I really liked Django: it is a versatile and powerful Web Framework with almost any feature just an import directive away! You do not even feel like you are writing in Python.
In short, this book is a great companion to starting developing Web Apps in Django, it was the key to my success.
The practical part of the book begins with building a personal blog website: who knows maybe you will use to your advantage while learning! The journey continues with building a social website. It was fun! A lot of the material there rotated around the user authentication that I found being essential to such Web apps. From there we go to creating an online shop: as you guessed it: a very much in demand and useful skill. So you are in a good company. However, the learning journey does not stop there, it continues to building an E-Learning Platform. This is a splendid and welcome part. Besides, the book does not end with only these Web Apps, it has more. Lastly it obviously includes how to finally go live. My final thoughts: The best and most liked by me chapter was on tracking user actions. It is very uncommon in the other books, but the author made a correct choice. The book author nicely summarizes the chapters with useful and succinct "good to know"s that would be used in the future for a quick look up or refreshes. If I were asked what could be improved is probably the length of several chapters in the book. The other is the absence (probably to keep the book size lower) the unit testing. You will enjoy both the book and Django!
I had the opportunity to read this excellent book. Now I wish that I had it before starting my last Python project.
This book explains simple to advanced topics in order to build correctly architected Django applications. In my real-life project, I had to discover and understand these topics by myself, and I finally spent 3 months to develop my own social media website. In fact, the examples of this book are more advanced than my features.
The book explains how to set up and build Django projects step by step by leveraging the framework's versatility and flexibility. One example is the blog project. The ride took me from saving posts to tagging comments. I also learned how to improve the performances, how to write powerful QuerySets, how to share recommendations, the search bar and ways to implement it as well as the making of a sitemap.
Another example is the social media website. The author details how to build the backspine of the site, he teaches the adding of meaningful features like social login, sharing of content.
Each topic is explained in details. I was happy to have both the how and the why in the explanations. The book also addresses performance and SEO optimization as well as debugging. Please note that there are many links to online resources.
It is a step by step guide to building web applications whether you are new to django or an experienced developer.
The first chapters introduce you to the basics of django like the ORM, DTL, Migrations, Models etc. which is perfect for someone who is just starting to learn, and doing it together with a project is a great way to teach not only the theoretical concepts (one good thing is that it teaches good SEO practices).
Then in the last two projects he covers more advanced topics like social auth, django celery, payments, websockets, ASGI, deployment with dockerm etc. (The book covers 4 projects ranging from basic to more advanced topics).
It explains perfectly every concept during the creation of the project (easier to follow if you are new and don't understand a bit of django documentation).
For someone like me who has been learning django for about 6 months, it complements very well my needs to improve my skills as a web developer. The author makes the learning process clear, easy to follow and fun.
I recently purchased "Django 4 by Example" by Antonio Melé and I couldn't be happier with it.
The book has been an invaluable resource, guiding me from a beginner to an intermediate level in Django. The explanations are clear, and the examples are incredibly helpful.
To my surprise, I discovered that Django 5 had just been released. Upon reaching out to Antonio, he generously provided me with guidance for the changes to "Django 5". This gesture is a testament to his outstanding customer service and commitment to his readers.
I am extremely grateful for both the knowledge I've gained from his book and the exceptional service Antonio has provided. Thank you so much for your kindness and support. I highly recommend this book to anyone looking to learn Django.
I read the third edition of the book in 2020. I knew nothing about Django and in a short time I built a complete site step by step on my own. The book with simple content and easy steps teaches the user how to build templates, database, authentication, Django Model view template system. There are easy examples that can be copied and modified to learn and improve the site on your own. Then we move on to creating concrete examples of applications. I recommend this book to everyone. The latest edition has improved by including the possibility of using Docker to containerize the site and the possibility of going online
Antonio's Django 5 by Example book gives the reader a solid foundation in Django using valuable examples. The best part this book doesn't even skip one of the most challenging parts "Deployment".
Nothing is left out and after reading this book even a beginner to Django will have the confidence to build/release their own web applications. I always recommend his Django by example books to any one on my team.