Book description
Django, the Python-based equivalent to the Ruby on Rails web development framework, is hottest topics in web development. In The Definitive Guide to Django: Web Development Done Right, Adrian Holovaty, one of Django's creators, and Django lead developer Jacob Kaplan-Moss show you how they use this framework to create award-winning web sites. Over the course of three parts, they guide you through the creation of a web application reminiscent of chicagocrime.org.
The first part of the book introduces Django fundamentals like installation and configuration. You'll learn about creating the components that power a Django-driven web site. The second part delves into the more sophisticated features of Django, like outputting non-HTML content (such as RSS feeds and PDFs), plus caching and user management. The third part serves as a detailed reference to Django's many configuration options and commands. The book even includes seven appendices for looking up configurations options and commands. In all, this book provides the ultimate tutorial and reference to the popular Django framework.
Table of contents
- About the Authors
- About the Technical Reviewer
- Acknowledgments
- Introduction
-
I. Getting Started
- 1. Introduction to Django
- 2. Getting Started
- 3. The Basics of Dynamic Web Pages
- 4. The Django Template System
-
5. Interacting with a Database: Models
- The "Dumb" Way to Do Database Queries in Views
- The MTV 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
- Making Changes to a Database Schema
- What's Next?
- 6. The Django Administration Site
- 7. Form Processing
-
8. Advanced Views and URLconfs
-
URLconf Tricks
- Streamlining Function Imports
- Using Multiple View Prefixes
- Special-Casing URLs in Debug Mode
- Using Named Groups
- Understanding the Matching/Grouping Algorithm
- Passing Extra Options to View Functions
- Using Default View Arguments
- Special-Casing Views
- Capturing Text in URLs
- Determining What the URLconf Searches Against
- Including Other URLconfs
- What's Next?
-
URLconf Tricks
-
II. Django's Subframeworks
- 9. Generic Views
- 10. Extending the Template Engine
- 11. Generating Non-HTML Content
- 12. Sessions, Users, and Registration
- 13. Caching
- 14. Other Contributed Subframeworks
- 15. Middleware
- 16. Integrating with Legacy Databases and Applications
- 17. Extending Django's Admin Interface
-
18. Internationalization
- Specifying Translation Strings in Python Code
- Specifying Translation Strings in Template Code
- Creating Language Files
- How Django Discovers Language Preference
- The set_language Redirect View
- Using Translations in Your Own Projects
- Translations and JavaScript
- Notes for Users Familiar with gettext
- What's Next?
- 19. Security
- 20. Deploying Django
-
III. Appendixes
- A. Case Studies
-
B. Model Definition Reference
-
Fields
- Field Name Restrictions
- AutoField
- BooleanField
- CharField
- CommaSeparatedIntegerField
- DateField
- DateTimeField
- EmailField
- FileField
- FilePathField
- FloatField
- ImageField
- IntegerField
- IPAddressField
- NullBooleanField
- PhoneNumberField
- PositiveIntegerField
- PositiveSmallIntegerField
- SlugField
- SmallIntegerField
- TextField
- TimeField
- URLField
- USStateField
- XMLField
- Universal Field Options
- Relationships
- Model Metadata Options
- Managers
- Model Methods
- Admin Options
-
Fields
- C. Database API Reference
- D. Generic View Reference
-
E. Settings
- What's a Settings File?
- Designating the Settings: DJANGO_SETTINGS_MODULE
- Using Settings Without Setting DJANGO_SETTINGS_MODULE
-
Available Settings
- ABSOLUTE_URL_OVERRIDES
- ADMIN_FOR
- ADMIN_MEDIA_PREFIX
- ADMINS
- ALLOWED_INCLUDE_ROOTS
- APPEND_SLASH
- CACHE_BACKEND
- CACHE_MIDDLEWARE_KEY_PREFIX
- DATABASE_ENGINE
- DATABASE_HOST
- DATABASE_NAME
- DATABASE_OPTIONS
- DATABASE_PASSWORD
- DATABASE_PORT
- DATABASE_USER
- DATE_FORMAT
- DATETIME_FORMAT
- DEBUG
- DEFAULT_CHARSET
- DEFAULT_CONTENT_TYPE
- DEFAULT_FROM_EMAIL
- DISALLOWED_USER_AGENTS
- EMAIL_HOST
- EMAIL_HOST_PASSWORD
- EMAIL_HOST_USER
- EMAIL_PORT
- EMAIL_SUBJECT_PREFIX
- FIXTURE_DIRS
- IGNORABLE_404_ENDS
- IGNORABLE_404_STARTS
- INSTALLED_APPS
- INTERNAL_IPS
- JING_PATH
- LANGUAGE_CODE
- LANGUAGES
- MANAGERS
- MEDIA_ROOT
- MEDIA_URL
- MIDDLEWARE_CLASSES
- MONTH_DAY_FORMAT
- PREPEND_WWW
- PROFANITIES_LIST
- ROOT_URLCONF
- SECRET_KEY
- SEND_BROKEN_LINK_EMAILS
- SERIALIZATION_MODULES
- SERVER_EMAIL
- SESSION_COOKIE_AGE
- SESSION_COOKIE_DOMAIN
- SESSION_COOKIE_NAME
- SESSION_COOKIE_SECURE
- SESSION_EXPIRE_AT_BROWSER_CLOSE
- SESSION_SAVE_EVERY_REQUEST
- SITE_ID
- TEMPLATE_CONTEXT_PROCESSORS
- TEMPLATE_DEBUG
- TEMPLATE_DIRS
- TEMPLATE_LOADERS
- TEMPLATE_STRING_IF_INVALID
- TEST_RUNNER
- TEST_DATABASE_NAME
- TIME_FORMAT
- TIME_ZONE
- URL_VALIDATOR_USER_AGENT
- USE_ETAGS
- USE_I18N
- YEAR_MONTH_FORMAT
-
F. Built-in Template Tags and Filters
- Built-in Tag Reference
-
Built-in Filter Reference
- add
- addslashes
- capfirst
- center
- cut
- date
- default
- default_if_none
- dictsort
- dictsortreversed
- divisibleby
- escape
- filesizeformat
- first
- fix_ampersands
- floatformat
- get_digit
- join
- length
- length_is
- linebreaks
- linebreaksbr
- linenumbers
- ljust
- lower
- make_list
- phone2numeric
- pluralize
- pprint
- random
- removetags
- rjust
- slice
- slugify
- stringformat
- striptags
- time
- timesince
- timeuntil
- title
- truncatewords
- truncatewords_html
- unordered_list
- upper
- urlencode
- urlize
- urlizetrunc
- wordcount
- wordwrap
- yesno
-
G. The django-admin Utility
- Usage
-
Available Actions
- adminindex [appname appname ...]
- createcachetable [tablename]
- dbshell
- diffsettings
- dumpdata [appname appname . . .]
- flush
- inspectdb
- loaddata [fixture fixture . . .]
- reset [appname appname . . .]
- runfcgi [option]
- runserver [optional port number, or ipaddr:port]
- shell
- sql [appname appname . . .]
- sqlall [appname appname . . .]
- sqlclear [appname appname . . .]
- sqlcustom [appname appname . . .]
- sqlindexes [appname appname . . .]
- sqlreset [appname appname . . .]
- sqlsequencereset [appname appname . . .]
- startapp [appname]
- startproject [projectname]
- syncdb
- test
- validate
- Available Option
- H. Request and Response Objects
Product information
- Title: The Definitive Guide to Django: Web Development Done Right
- Author(s):
- Release date: August 2008
- Publisher(s): Apress
- ISBN: 9781590597255
You might also like
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Learning Go
Go is rapidly becoming the preferred language for building web services. While there are plenty of …
book
The Staff Engineer's Path
For years, companies have rewarded their most effective engineers with management positions. But treating management as …
book
Database Systems: Concepts, Design and Applications
This book is a comprehensive, practical, and student-friendly textbook addressing fundamental concepts in database design and …