Two Scoops of Django 1.11 Will Help You Build Django Projects.
In this book, we introduce you to the various tips, tricks, patterns, code snippets, and techniques that we've picked up over the years. We have put thousands of hours into the fourth edition of the book, writing and revising its material to include significant improvements and new material based on feedback from previous editions.
* Studied history * Learned how to fight with swords * Ridden horses * Cycled thousands of miles * Performed cartwheels in capoeira circles on multiple continents * Worked as an engineer at NASA * Married a woman he dreamed about before he ever met her
He believes this combination of skills and experiences makes him the ideal fantasy and tech author.
The best book for experienced Django developers to up their skills and code quality.
This book covers the best-practices from setting up the development environment, asynchronous processing, to the deployment.
Readers note that this is not a tutorial book. To get the most out of it, you must have 1-year experience of working with Django. Or, if you know your way around, say, models, you can jump into the corresponding chapter and make your code cleaner
It has been an informative and entertaining read for me.
The interesting thing is, although this is a book about Django, the range of topics covered are wide, beyond that of Django-specific practices. Beside Django, the authors also touched various other topics on web development life cycle. Some examples include setting up your environment, testing, documentation, deployment, and even where to look for helps.
Needless to say, a 500 pages book cannot cover this amount of material in sufficient depth. Instead, the authors have decided to focus on the Django-specific chapters and only give us a glimpse of the other topics. These chapters are very basic and additional details can found from the linked references.
On the other hand, the topics regarding Django-specific features and best practices are covered in sufficient depth. The authors stroke a good balance between giving too much and too little details. The chapters are short, easy to read, and very informative.
Sometime, however, the authors assumes that a certain best practices is self-explanatory and does not need much justification. I had this problem with their advocacy on using mixins and preference for Class Based Views. However, this is not a serious problem.
Overall, I considered this to be a job well done. The authors succeeded in presenting the best practices of the Django web framework in an entertaining format. I would recommend for anyone who has learnt the basic and is ready to dive deeper into the Django web framework.
I was looking for a good book to learn Django and this one was at the top of the lists. So, let's start with a quote.
This book is not a tutorial. If you are new to Django, this book will be helpful but large parts will be challenging for you. (p. xxxi)
I've been doing web apps for many years, and I've dabbled in Python a while back. Surely I'll be smart enough to fill in the gaps, provided the examples have enough context.
The early chapters about setting up a project and organizing settings went fine. The authors zeroed in on one approach, gave a trivial example, and discussed the forces at play. It's opinionated, but I can relate. But by the time we get to models and database queries and views, the trivial examples are gone and there is nothing to establish a context for the conversation. There are deep links to the official documentation, but I basically have to put the book down to go read a ton of materials on the web before I can continue on.
So I stopped reading after ~20%. I'll come back to it when I know Django better.
Django is now at version 2.0.6 but the book is about version 1.11. A quick search for the differences listed some rather advanced concepts, so I think it should still hold up for casual users.
If you have a year or so of experience with Django framework and look forward to expand your horizons - this book is a must read.
Two Scoops of Django touches on broad spectrum of topics, not only Django internals like views, models, ORM, etc.. But also deployment, security, debugging, testing, monitoring, and much more.
Written with multiple real life (ice-cream based) examples it never goes too much into theoretical concepts, keeps everything relevant and relatable, which motivates to read on.
If you're like me, not only will you get insight into industry-standard solutions to problems you patched "somehow" sometime in the past, but also a sneak peak to problems that are coming in near future, only now you'll have the tools and knowledge to tackle them properly!
سالها بود که جنگو کد نزده بودم و این بهترین کتابی بود که میتونستم بخونم. تقریبا هرچیز جدیدی که اضافه شده بود این کتاب توضیح داده بود. طبیعتا بیش از نصفش حرفای تکراری بود ولی در کل خیلی خوب بود تو این کتاب از django performance هم خیلی تعریف کرده بود . به زودی اونم میخونم
Read about 75% of this, which is what applies to my immediate goals. I'll be revisiting these chapters frequently and the remaining ones when projects reach those needs. Excellent resource.
very good book to skill up your Django knowledge. It explains best practices in Django in high level. Doesn't matter if we have Django 3 right now, reading this book boosts up your skills.
I read the version for Django 3.x. Wowzah - worth its weight in gold and well worth a re-read. While Daniel and Audrey give countless tips for specific tools and practices, I benefitted most from the high-level concepts and best practices that come from their years of experience. As a novice in the tech world, having read this book, I feel much more confident and excited to continue growing (as well as intimidated by how much there is to learn, especially with security).
Things I don't want to forget: - Recommended Django project structure (core app; multiple settings files that inherit from base from dev, staging, prod; keep templates in template directory and list apps as subdirectories; using shallow JSON (non version-controlled, gitignore) instead of environment variables for keys and passwords) - PEP styling (like import order of (1) stdlib imports, (2) core django imports, (3) third party imports, (4) internal app imports) - The benefit and necessity of database transactions where two or more db updates are wrapped in a single unit of work (and can be easily rolled back in case of one failure to avoid db corruption) - Avoid raw SQL in app since it is db-specific - Bias toward class-based views over function-based views (Keep business logic out of views!!) - A Django view is just a callable that accepts a request object and returns an HTTP response - The most important thing to remember about forms is that they should be used to validate incoming data (although forms are also commonly used for simply GET searches that don't manipulate the db) - Always us CSRF (Cross-Site Request Forgery) when modifying data (i.e. using POST) - HTML's {{ block.super }} allowing templates to inherit from base without overriding base content (like when base has style sheet that is needed downstream, but downstream templates have other specific stylesheets) - REST APIs are really just another type of view (HTTP request to return HTTP response) - Mask latency with animations! - Django Admin is one of the main reasons to use Django over other web frameworks - Since Django only allows one User table, the author's recommendation/preference is to link back from a related model and combine with proxy models (since these don't add fields). This way users can be assigned to multiple roles where role-specific fields can be managed in downstream, linked tables. - Fun little library for testing Django projects: "coverage" (gamify your testing exposure by trying to keep the testing percentage higher for each new commit) - Set up a CI (Continuous Integration) server to run your test suite with every new commit/push - Excellent introduction to security: you must have HTTPS for your entire site (locks communication between site and end user, ensuring that web content is not being manipulated through the middle man injection) - Don't store unnecessary data unless legally required to do so (including payment/CC information or PII/PHI) - In Appendix C, there are even more additional resources!!😄
Never thought that a programming book would be so engaging and so fun to read. Or after having read a couple I thought that the enthusiasm would wane off. Rare combination: Fun to read, interesting content, some of it can be flair based on your knowledge on the subject, some of it gold. I run through it a couple of times to get a grasp of the subjects, while changing my code-base in small increments following the advice. Will be circling around it for the next months.
Trying to limit my enthusiasm: (1) Good articulated content, (2) page turner(!), (3) many references on where to go for here if I want to do more (4) written from the people that maintain cookiecutter so purchasing it kind of makes me feel that I am helping them financially for all the time they saved me.
You only need to be a bit cautious if you do not know Python beforehand as it is a Django book not a Python one. Cannot wait (it is Saturday) for Monday to touch my code-base to implement more recommendations.
Update: coming back again and again after couple of months: +1 star :)