Two Scoops of Django 1.6 Change List

This is the 'short' list of changes between Two Scoops of Django 1.5 and the just released 1.6 edition.

note: We are in the progress of organizing this and making it better.

  • 130+ more pages!
  • Added 'About the Dedication' to the author's notes and included in the table of contents
  • 5 new chapters!
    • Chapter 8: Function-Based Views
    • Chapter 15: Consuming REST APIs in Templates
    • Chapter 27: Deployment: Platforms as a Service (Expanded breakout from the 1.5 Deployment chapter)
    • Chapter 29: Identical Environments
    • Chapter 30: Continuous Integration
  • 3 new appendixes!
    • Appendix D: Internationalization and Localization
    • Appendix E: Settings Alternatives
    • Appendix F: Working with Python 3
  • Massive expanded and enhanced the index.
  • We'll be providing code examples taken from the book. note: The code examples will not include working Django projects or apps.
  • Entire book
    • Many grammar and spelling corrections. Many rewordings of explanations to make them more concise.
    • All code example docstrings now follow PEP 257
    • More tables!
    • Implemented code highlighting
    • Improved section and subsection design across the book
    • Added a gelato reference. The first person who identified it was Jason Meredith, who provided the page number where it's located and its entire line of text. In return he received a free copy of Two Scoops of Django: Best Practices for Django 1.6. The contest was managed at https://github.com/twoscoops/two-scoops-of-django-1.6/issues/3.
  • Introduction
    • Changed ice cream preferences
    • Changed to primarily support for Django 1.6
    • Changed to primarily support Python 2.7.x and Python 3.3. Note: There are a few mentions of Django 1.7 and 1.5 later in the book.
    • Added errata link
    • Added link to code samples
  • Chapter 1, Coding Style
    • Added tip for using flake8 (section 1.2)
    • Added segment on line length issues (section 1.2.1)
    • After careful discussion with Python core developers, carefully revised material on explicit relative imports (section 1.4)
      • Added tip from __future__ import absolute_import (section 1.4)
      • Revised table 1.1
  • Chapter 2, Environment Setup
    • Added brief section mentioning Vagrant (section 2.5)
  • Chapter 3, How to Lay Out Django Projects
    • For the sake of discoverability, specify django-twoscoops-project and django-skel at the start of the chapter.
  • Chapter 4, Fundamentals of App Design
    • Made it more clear that Django Apps are listed in INSTALLED_APPS
    • Various other minor clarifications
  • Chapter 5, Settings and Requirements File
    • New virtualenv postactivate script for setting PYTHONPATH and DJANGO_SETTINGS_MODULE (tip box at end of section 5.2)
    • Switched to use EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' in development settings. (section 5.2.1)
    • Added section about Apache and environment variables (section 5.4)
    • Added section on loading of secrets from non-executable files (section 5.4)
  • Chapter 6, Database/Models
    • Added FileField and ImageField to Table 6.2 (section 6.2.4)
    • Add section about models.fields.BinaryField (Section 6.2.5)
    • Use GenericIPAddressField instead of IPAddressField (section 6.2.4)
    • Added section on transactions (section 6.4)
  • Chapter 7, Function- and Class-Based Views
    • New section describing URL Namespaces much more explicitly (section 7.4)
  • New Chapter 8, "Best Practices for Function-Based Views"
    • Advantages of FBVs (section 8.1)
    • Passing the request object (section 8.2)
    • Decorators (section 8.3)
    • Passing the response object (section 8.4)
  • Chapter 9, "Best Practices for Class-Based Views"
    • Distinguish between CBVs and GCBVs
    • Added subsection in CBVs chapter on using the view object itself to store state (section 9.4.4)
    • Added section on using just django.views.generic.View (section 9.6)
  • Chapter 10, "Forms"
    • General grammar and spell improvements
    • Update Django CBV UpdateView and CreateView view code to use explicit field attributes (across chapter 10)
  • Chapter 11, "More things about forms"
    • General grammar and spell improvements
  • Chapter 12, "Templates: Best Practices"
    • General content and language improvements
    • Add section on serving error pages as static HTML (section 12.8)
  • Chapter 14, "Building REST APIs"
    • Added 410 response to HTTP methods used when creating REST APIs. (section 14.1)
    • Tip box about REST API version syntax (section 14.2)
    • Added Resources vs RPC section (14.4.2)
    • Broke out client-side material into Chapter 15
  • New Chapter 15, "Consuming REST API in Templates"
    • Broke out into it's own chapter since it's a very different topic then creating REST APIs. Because of the repidity of change and volume of content, this is addressed at a high level.
    • Debugging (section 15.1)
    • JavaScript-Powered Static Asset Preprocessors (section 15.2)
    • Making content indexable (section 15.3)
    • Real-time woes a.k.a. latency (section 15.4)
    • Avoiding anti-patterns (section 15.5)
    • AJAX and the CSRF token, brought over (section 15.6)
    • Improving JavaScript skills (section 15.7)
    • Javascript Coding Standards (section 15.8)
    • Django and Javascript Tutorials, brought over (section 15.9)
  • Chapter 16, FrankenDjango - replacing stuff from core
    • Mention use of PostgreSQL advanced features like JSON and Hstore (section 16.1)
    • Added discussion point about NoSQL/Schemaless vs Relational Databases (section 16.3)
  • Chapter 17, Working with the Django Admin
    • Sample string representation of model instance now works with both Python 2 and 3 (section 17.1)
    • Switched from format_str method to format_html (section 17.4)
    • Added warning against using list_editable view in multiuser environments (section 17.5)
    • Using custom skins (section 17.8)
  • Chapter 18: Dealing with the user model
    • Greatly expanded the User Profile section
    • Added more practices for custom user models.
    • Added more advice on using AUTH_MODEL_USER and get_user_model()
    • Added django.utils.html.format_html (section 26.2.4)
    • Removed custom user model tutorial from the User model chapter. Did this because Two Scoops is not a tutorial
  • Third-party package chapter enhancements (chapter 19)
    • Added semver.org to chapter on third party packages (section 19.10.10)
    • Added naming section to third-party packages (section 19.10.11)
    • Added creating third-party packages (section 19.11)
    • Added maintaining third-party packages (section 19.12)
    • Added wheels (section 19.12.4)
    • Mentioned cookiecutter
  • Chapter 20, "Testing"
    • Flatten test directory because it's PEP-0020 (section 20.2)
    • Add subsection recommending use of RequestFactory (section 20.3.2)
    • Suggest adding docstrings inside of unittests (section 20.3.7)
    • Removed tipbox on using SQLite3 to speed up testing. This is a recipe for subtle type problems to creep into your project.
  • Chapter 21, Documentation
    • Added section on Markdown (section 21.5)
    • Added resources to documentation (21.4 and 21.5)
  • Chapter 22, Finding and reducing bottlenecks
    • Added 'depth' argument to usages of select related (section 22.2.2)
  • Chapter 23, Security (chapter 23)
    • Expanded the section on ALLOWED_HOSTS
    • Provided better guidance on HSTS management
    • Explained better the role of CSRF in REST API design
    • Added preference for template escaping of content rather than use of mark_safe
    • Recommended JSON encoding of data for client-side Javascript
    • Reworded and made stronger the discussion against the use of Pickle for any user-touched data
    • Expanded section of cookie-based sessions. Summary: Don't use them and if you do, use JSON-powered cookie-based sessions.
    • Added section on removing autocomplete from critical fields.
    • Added link to PCI article written by Ken Cochrane.
    • Added link and encouragement to subscribe to django-announce mailing list
    • Added warning against use of Admin list_editables.
    • New section on creating a disaster plan.
    • How to manage 0-Day exploits of your project
    • Added section on XML bombing and defusedxml (section 23.22)
  • Chapter 25, Signals
    • Suggested use of helper functions to replace signals (section 25.2.4)
  • Chapter 26, Utilities
    • Added cached_property (section 26.2.3)
    • Added django.utils.html.format_html (section 26.2.4)
    • Added section on Exceptions in utilities chapter (section 26.3)
    • Added section on serialization (section 26.4)
  • New Chapter 27: Deployment: Platforms as a Service
    • Technically a breakout from the 1.5 edition deployment chapter, this is a large expansion.
    • Evaluating PaaS (Section 27.1)
    • Best Practices (Section 27.2)
  • Deployment chapter enhancements (Chapter 28)
    • Broke the Platform-as-a-Service material into Chapter 27
    • Describe and chart single-server setups (section 28.1)
    • Describe and chart multi-server setups (section 28.2)
    • Add tip box for using redis for all ephemeral data (YMMV)
    • Rewrote and revised the WSGI Application Server section (28.3)
      • Rewrote warning against using mod_python.
      • Added description uWSGI being Nginx proxy (section 28.3.1)
      • Added working with Apache and environment variables (section 28.3.2)
      • Added working with Apache and virtualenv (section 28.3.3)
    • Added section on automated, repeatable deployments (section 28.4)
      • Covered popular dev ops choices used in the Django community (section 28.4.1)
      • Specific material for SaltStack (section 28.4.2)
      • Specific mention of Ansible (section 28.4.3)
  • New Chapter 30:, Identical Environments
    • Added Virtualbox (chapter 30)
    • Added Vagrant (section 30.1)
  • New Chapter: Chapter 31, Continuous Integration
    • Principles (section 31.1)
    • Tools (section 31.2)
    • CI as a Service (section 31.3)
    • Resources (section 31.4)
  • Chapter 32: Closing thoughts
  • Appendix A: Packages used in this book
    • Many, many packages added
    • Added entries to the index to make researching packages easier
  • Appendix B:
    • Grammar and spelling improvements
  • Appendix C: Additional Resources
    • More resources for learning Django and Python
    • Added JavaScript resources
  • Added Appendix D: Internationalization and Localization
    • Translation function table
    • 8 sections of content
  • Added Appendix E: Settings Alternatives
    • Mentioned the 12-Factor app single settings module
    • Mentioned Brandon Konkle's variation of the One True Way
  • Added Appendix F: Working with Python 3
    • Python 2 and 3 compatability
    • 9 sections of content
  • Index
    • Lots more entries
    • Every entry in the index has been double-checked to ensure that all text references are linked in the index.
    • All security issues referenced under 'security'
    • All packages listed in one section, broken up by letter groups.