You are previewing Pro Django.

Pro Django

Cover of Pro Django by Marty Alchin Published by Apress
  1. Title Page
  2. Contents at a Glance
  3. Contents
  4. About the Author
  5. Acknowledgments
  6. Preface
  7. Introduction
    1. What This Book Is Not
    2. Who This Book Is For
    3. Interpreting Code Samples
    4. Prerequisites
  8. CHAPTER 1: Understanding Django
    1. Philosophy
    2. Community
    3. Now What?
  9. CHAPTER 2: Django Is Python
    1. How Python Builds Classes
    2. Common Duck-Typing Protocols
    3. Augmenting Functions
    4. Descriptors
    5. Introspection
    6. Applied Techniques
    7. Now What?
  10. CHAPTER 3: Models
    1. How Django Processes Model Classes
    2. Getting Information About Models
    3. Using Model Fields
    4. Subclassing Fields
    5. Dealing with Files
    6. Signals
    7. Applied Techniques
    8. Now What?
  11. CHAPTER 4: URLs and Views
    1. URLs
    2. Views
    3. Applied Techniques
    4. Now What?
  12. CHAPTER 5: Forms
    1. Declaring and Identifying Fields
    2. Binding to User Input
    3. Custom Fields
    4. Defining HTML Behavior
    5. Applied Techniques
    6. Now What?
  13. CHAPTER 6: Templates
    1. What Makes a Template
    2. Context
    3. Retrieving Templates
    4. Adding Features for Templates
    5. Applied Techniques
    6. Now What?
  14. CHAPTER 7: Handling HTTP
    1. Requests and Responses
    2. Writing HTTP Middleware
    3. HTTP-Related Signals
    4. Applied Techniques
    5. Now What?
  15. CHAPTER 8: Backend Protocols
    1. Database Access
    2. Authentication
    3. Files
    4. Session Management
    5. Caching
    6. Template Loading
    7. Context Processors
    8. Applied Techniques
    9. Now What?
  16. CHAPTER 9: Common Tools
    1. Core Exceptions
    2. Text Modification
    3. Data Structures
    4. Functional Utilities
    5. Signals
    6. Now What?
  17. CHAPTER 10: Coordinating Applications
    1. Contacts
    2. Real Estate Properties
    3. Now What?
  18. CHAPTER 11: Enhancing Applications
    1. Recording the Current User
    2. Keeping Historical Records
    3. Now What?
  19. APPENDIX: Contributing to Django
    1. Reporting a Ticket
    2. Supplying a Patch
    3. Writing Tests
    4. Writing Documentation
    5. Development Sprints
    6. Publishing Code
    7. Releasing an Application
  20. Index
O'Reilly logo

CHAPTER 3Models

Data is at the center of most modern Web applications, and Django aims to provide support for a variety of data structures and persistence options. Models are the primary aspect of the traditional MVC model that Django maintains intact. Models are an essential part of any application that needs to persist data across multiple requests, sessions or even server instances.

Django models are defined as standard Python classes, with a wealth of additional features added in automatically. Behind the scenes, an object-relational mapper (ORM) allows these classes and their instances access to databases. Without this ORM, developers would be required to deal with the database directly, using Structured Query Language (SQL), the standard ...

The best content for your career. Discover unlimited learning on demand for around $1/day.