Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Django and Patterns; Why Django?; The story of Django; A framework is born; Removing the magic; Django keeps getting better; How does Django work?; What is a Pattern?; Gang of Four Patterns; Is Django MVC?; Fowler's Patterns; Are there more patterns?; Patterns in this book; Criticism of Patterns; How to use Patterns; Best practices; Python Zen and Django's design philosophy; Summary; Chapter 2: Application Design; How to gather requirements; Are you a story teller?
HTML mockupsDesigning the application; Dividing a project into Apps; Reuse or roll-your-own?; My app sandbox; Which packages made it?; Before starting the project; SuperBook your mission, should you choose to accept it; Why Python 3?; Starting the project; Summary; Chapter 3: Models; M is bigger than V and C; The model hunt; Splitting models.py into multiple files; Structural patterns; Patterns: normalized models; Problem details; Solution details; Pattern: Model mixins; Problem details; Solution details; Pattern: User profiles; Problem details; Solution details; Pattern: Service objects
Problem detailsSolution details; Retrieval patterns; Pattern: Property field; Problem details; Solution details; Pattern: Custom model managers; Problem details; Solution details; Migrations; Summary; Chapter 4: Views and URLs; A view from the top; Views got classier; Class-based generic views; View mixins; Order of mixins; Decorators; View patterns; Pattern: Access controlled views; Problem details; Solution details; Pattern: Context enhancers; Problem details; Solution details; Pattern: Services; Problem details; Solution details; Designing URLs; URL anatomy; What happens in urls.py?
The URL pattern syntaxNames and namespaces; Pattern order; URL pattern styles; Summary; Chapter 5: Templates; Understanding Django's template language features; Variables; Attributes; Filters; Tags; Philosophy: Don't invent a programming language; Organizing templates; Support for other template languages; Using Bootstrap; But they all look the same!; Template patterns; Pattern: Template inheritance tree; Problem details; Solution details; Pattern: The active link; Problem details; Solution details; Summary; Chapter 6: Admin Interface; Using the admin interface; Enhancing models for the admin
Not everyone should be an adminAdmin interface customizations; Changing the heading; Changing the base and stylesheets; Adding a Rich Text Editor for WYSIWYG editing; Bootstrap-themed admin; Complete overhauls; Protecting the admin; Pattern: Feature flags; Problem details; Solution details; Summary; Chapter 7: Forms; How forms work; Forms in Django; Why does data need cleaning?; Displaying forms; Time to be crisp; Understanding CSRF; Form processing with Class-based views; Form patterns; Pattern: Dynamic form generation; Problem details; Solution details; Pattern: User-based forms