The Definitive Guide To Django: Web Development Done Right

Transcription

The Definitive Guide to Django:Web Development Done RightAdrian Holovaty, Jacob K. Mosswww.djangobook.comBuy at AmazonISBN-10: 1590597257ISBN-13: 978-1590597255

The Django BookTable of Contents1 Introduction to Django.11.1 What Is a Web Framework?.11.2 The MVC Design Pattern.21.3 Django’s History.31.4 How to Read This Book.41.4.1 Required Programming Knowledge.51.4.2 Required Python Knowledge.51.4.3 New Django Features.51.4.4 Getting Help.51.4.5 What’s Next.62 Getting Started.72.1 Installing Python.72.2 Installing Django.72.2.1 Installing an Official Release.72.2.2 Installing Django from Subversion.82.3 Setting Up a Database.82.3.1 Using Django with PostgreSQL.92.3.2 Using Django with SQLite 3.92.3.3 Using Django with MySQL.92.3.4 Using Django Without a Database.92.4 Starting a Project.102.4.1 The Development Server.102.5 What’s Next?.113 The Basics of Dynamic Web Pages.123.1 Your First View: Dynamic Content.123.2 Mapping URLs to Views.133.3 How Django Processes a Request.153.3.1 How Django Processes a Request: Complete Details.163.4 URLconfs and Loose Coupling.173.5 404 Errors.173.6 Your Second View: Dynamic URLs.183.6.1 A Word About Pretty URLs.193.6.2 Wildcard URLpatterns.193.7 Django’s Pretty Error Pages.213.8 What’s next?.234 The Django Template System.244.1 Template System Basics.244.2 Using the Template System.254.2.1 Creating Template Objects.254.2.2 Rendering a Template.274.2.3 Multiple Contexts, Same Template.284.2.4 Context Variable Lookup.294.2.5 Playing with Context Objects.314.3 Basic Template Tags and Filters.324.3.1 Tags.324.3.2 Filters.364.4 Philosophies and Limitations.374.5 Using Templates in Views.384.6 Template Loading.39i

The Django BookTable of Contents4 The Django Template System4.6.1 render to response().414.6.2 The locals() Trick.424.6.3 Subdirectories in get template().424.6.4 The include Template Tag.434.7 Template Inheritance.444.8 What’s next?.475 Interacting with a Database: Models.485.1 The “Dumb” Way to Do Database Queries in Views.485.2 The MTV Development Pattern.495.3 Configuring the Database.505.4 Your First App.525.5 Defining Models in Python.535.6 Your First Model.545.7 Installing the Model.555.8 Basic Data Access.575.9 Adding Model String Representations.585.10 Inserting and Updating Data.595.11 Selecting Objects.605.11.1 Filtering Data.615.11.2 Retrieving Single Objects.615.11.3 Ordering Data.625.11.4 Chaining Lookups.635.11.5 Slicing Data.635.12 Deleting Objects.645.13 Making Changes to a Database Schema.645.13.1 Adding Fields.645.13.2 Removing Fields.665.13.3 Removing Many-to-Many Fields.665.13.4 Removing Models.665.14 What’s Next?.676 The Django Administration Site.686.1 Activating the Admin Interface.686.2 Using the Admin Interface.696.2.1 Users, Groups, and Permissions.766.3 Customizing the Admin Interface.776.4 Customizing the Admin Interface’s Look and Feel.796.5 Customizing the Admin Index Page.796.6 When and Why to Use the Admin Interface.806.7 What’s Next?.807 Form Processing.817.1 Search.817.2 The “Perfect Form”.837.3 Creating a Feedback Form.837.4 Processing the Submission.867.5 Custom Validation Rules.877.6 A Custom Look and Feel.887.7 Creating Forms from Models.897.8 What’s Next?.90ii

The Django BookTable of Contents8 Advanced Views and URLconfs.

The Definitive Guide to Django: Web Development Done Right Adrian Holovaty, Jacob K. Moss www.djangobook.com Buy at Amazon ISBN-10: 1590597257 ISBN-13: 978-1590597255