Django Book
Introduction
Chapter 1: Introduction to Django
What Is A Web Framework?
The MVC Design Pattern
Django’s History
How To Read This Book
Chapter 2: Getting Started
Installing Python
Installing Django
Testing the Django installation
Setting Up a Database
Starting a Project
What’s Next?
Chapter 3: Views and URLconfs
Your First Django-Powered Page: Hello World
How Django Processes a Request
Your Second View: Dynamic Content
URLconfs and Loose Coupling
Your Third View: Dynamic URLs
Django’s Pretty Error Pages
What’s next?
Chapter 4: Templates
Template System Basics
Using the Template System
Basic Template Tags and Filters
Philosophies and Limitations
Using Templates in Views
Template Loading
Template Inheritance
What’s next?
Chapter 5: Models
The “Dumb” Way to Do Database Queries in Views
The MTV (or MVC) Development Pattern
Configuring the Database
Your First App
Defining Models in Python
Your First Model
Installing the Model
Basic Data Access
Adding Model String Representations
Inserting and Updating Data
Selecting Objects
Deleting Objects
What’s Next?
Chapter 6: The Django Admin Site
The django.contrib packages
Activating the Admin Interface
Using the Admin Site
Adding Your Models to the Admin Site
How the Admin Site Works
Making Fields Optional
Customizing Field Labels
Custom ModelAdmin classes
Users, Groups, and Permissions
When and Why to Use the Admin Interface – And When Not to
What’s Next?
Chapter 7: Forms
Getting Data From the Request Object
A Simple Form-Handling Example
Improving Our Simple Form-Handling Example
Simple validation
Making a Contact Form
Your First Form Class
Tying Form Objects Into Views
Changing How Fields Are Rendered
Setting a Maximum Length
Setting Initial Values
Custom Validation Rules
Specifying labels
Customizing Form Design
What’s Next?
Chapter 8: Advanced Views and URLconfs
URLconf Tricks
Including Other URLconfs
What’s Next?
Chapter 9: Advanced Templates
Template Language Review
RequestContext and Context Processors
Automatic HTML Escaping
Inside Template Loading
Extending the Template System
Writing Custom Template Loaders
Configuring the Template System in Standalone Mode
What’s Next
Chapter 10: Advanced Models
Related Objects
Making Changes to a Database Schema
Managers
Model methods
Executing Raw SQL Queries
What’s Next?
Chapter 11: Generic Views
Using Generic Views
Generic Views of Objects
Extending Generic Views
What’s Next?
Chapter 12: Deploying Django
Preparing Your Codebase for Production
Using Different Settings for Production
DJANGO_SETTINGS_MODULE
Using Django with FastCGI
Scaling
Performance Tuning
What’s Next?
Chapter 13: Generating Non-HTML Content
The basics: views and MIME-types
Producing CSV
Generating PDFs
Other Possibilities
The Syndication Feed Framework
The Sitemap Framework
What’s Next?
Chapter 14: Sessions, Users, and Registration
Cookies
Django’s Session Framework
Users and Authentication
Permissions, Groups and Messages
What’s Next
Chapter 15: Caching
Setting Up the Cache
The Per-Site Cache
The Per-View Cache
Template Fragment Caching
The Low-Level Cache API
Upstream Caches
Using Vary Headers
Controlling Cache: Using Other Headers
Other Optimizations
Order of MIDDLEWARE_CLASSES
What’s Next?
Chapter 16: django.contrib
The Django Standard Library
Sites
Flatpages
Redirects
CSRF Protection
Humanizing Data
Markup Filters
What’s Next?
Chapter 17: Middleware
What’s Middleware?
Middleware Installation
Middleware Methods
Built-in Middleware
What’s Next?
Chapter 18: Integrating with Legacy Databases and Applications
Integrating with a Legacy Database
Integrating with an Authentication System
Integrating with Legacy Web Applications
What’s Next?
Chapter 19: Internationalization
1. How to Specify Translation Strings
2. How to Create Language Files
3. How Django Discovers Language Preference
Using Translations in Your Own Projects
The
set_language
Redirect View
Translations and JavaScript
Notes for Users Familiar with
gettext
gettext
on Windows
What’s Next?
Chapter 20: Security
The Theme of Web Security
SQL Injection
Cross-Site Scripting (XSS)
Cross-Site Request Forgery
Session Forging/Hijacking
E-mail Header Injection
Directory Traversal
Exposed Error Messages
A Final Word on Security
What’s Next?
Appendix A: Model Definition Reference
Fields
Universal Field Options
Relationships
Model Metadata Options
Appendix B: Database API Reference
Creating Objects
Saving Changes to Objects
Retrieving Objects
Caching and QuerySets
Filtering Objects
Field Lookups
Complex Lookups with Q Objects
Related Objects
Deleting Objects
Shortcuts
Falling Back to Raw SQL
Appendix C: Generic View Reference
Common Arguments to Generic Views
“Simple” Generic Views
List/Detail Generic Views
Date-Based Generic Views
Appendix D: Settings
What’s a Settings File?
Designating the Settings: DJANGO_SETTINGS_MODULE
Using Settings Without Setting DJANGO_SETTINGS_MODULE
Available Settings
Appendix E: Built-in Template Tags and Filters
Built-in Tag Reference
Built-in Filter Reference
Appendix F: The django-admin Utility
Usage
Available subcommands
Default options
Extra niceties
Appendix G: Request and Response Objects
HttpRequest
HttpResponse
Django Book
Docs
»
Edit on Bitbucket
Алфавитный указатель