Django 1.6.dev20121223155050 documentation
Home
|
Table of contents
|
Index
|
Modules
up
|
next
»
Django documentation contents
¶
Getting started
Django at a glance
Design your model
Install it
Enjoy the free API
A dynamic admin interface: it’s not just scaffolding – it’s the whole house
Design your URLs
Write your views
Design your templates
This is just the surface
Quick install guide
Install Python
Set up a database
Remove any old versions of Django
Install Django
Verifying
That’s it!
Writing your first Django app, part 1
Creating a project
Creating models
Activating models
Playing with the API
Writing your first Django app, part 2
Activate the admin site
Start the development server
Enter the admin site
Make the poll app modifiable in the admin
Explore the free admin functionality
Customize the admin form
Adding related objects
Customize the admin change list
Customize the admin look and feel
Customize the admin index page
Writing your first Django app, part 3
Philosophy
Write your first view
Writing more views
Write views that actually do something
Raising a 404 error
Write a 404 (page not found) view
Write a 500 (server error) view
Use the template system
Removing hardcoded URLs in templates
Namespacing URL names
Writing your first Django app, part 4
Write a simple form
Use generic views: Less code is better
Writing your first Django app, part 5
Introducing automated testing
Basic testing strategies
Writing our first test
Test a view
When testing, more is better
Further testing
What’s next?
Advanced tutorial: How to write reusable apps
Reusability matters
Completing your reusable app
Installing some prerequisites
Packaging your app
Using your own package
Publishing your app
Installing Python packages with virtualenv
What to read next
Finding documentation
How the documentation is organized
How documentation is updated
Where to get it
Differences between versions
Writing your first patch for Django
Introduction
Installing Git
Getting a copy of Django’s development version
Rolling back to a previous revision of Django
Running Django’s test suite for the first time
Writing some tests for your ticket
Writing the code for your ticket
Running Django’s test suite for the second time
Writing Documentation
Generating a patch for your changes
So what do I do next?
Using Django
How to install Django
Install Python
Install Apache and mod_wsgi
Get your database running
Remove any old versions of Django
Install the Django code
Models and databases
Models
Making queries
Aggregation
Managers
Performing raw SQL queries
Managing database transactions
Multiple databases
Tablespaces
Database access optimization
Examples of model relationship API usage
Handling HTTP requests
URL dispatcher
Writing views
View decorators
File Uploads
Django shortcut functions
Generic views
Middleware
How to use sessions
Working with forms
Overview
Form objects
Further topics
The Django template language
Templates
Variables
Filters
Tags
Comments
Template inheritance
Automatic HTML escaping
Accessing method calls
Custom tag and filter libraries
Class-based views
Class-based generic views
Form handling with class-based views
Using mixins with class-based views
Basic examples
Simple usage in your URLconf
Subclassing generic views
Decorating class-based views
Managing files
Using files in models
The
File
object
File storage
Testing in Django
Unit tests v. doctests
Where to go from here
User authentication in Django
Overview
Installation
Usage
Django’s cache framework
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
Conditional View Processing
The
condition
decorator
Shortcuts for only computing one value
Using the decorators with other HTTP methods
Comparison with middleware conditional processing
Cryptographic signing
Protecting the SECRET_KEY
Using the low-level API
Sending email
Quick example
send_mail()
send_mass_mail()
mail_admins()
mail_managers()
Examples
Preventing header injection
The EmailMessage class
Email backends
Testing email sending
Internationalization and localization
Overview
Definitions
Logging
A quick logging primer
Using logging
Configuring logging
Django’s logging extensions
Django’s default logging configuration
Pagination
Example
Using
Paginator
in a view
Paginator
objects
InvalidPage
exceptions
Page
objects
Porting to Python 3
Philosophy
Porting tips
Coding guidelines
Security in Django
Cross site scripting (XSS) protection
Cross site request forgery (CSRF) protection
SQL injection protection
Clickjacking protection
SSL/HTTPS
Host headers and virtual hosting
Additional security topics
Serializing Django objects
Serializing data
Deserializing data
Serialization formats
Natural keys
Django settings
The basics
Designating the settings
Default settings
Using settings in Python code
Altering settings at runtime
Security
Available settings
Creating your own settings
Using settings without setting DJANGO_SETTINGS_MODULE
Signals
Listening to signals
Defining and sending signals
Disconnecting signals
“How-to” guides
Authentication using
REMOTE_USER
Configuration
RemoteUserBackend
Writing custom django-admin commands
Command objects
Writing custom model fields
Introduction
Background theory
Writing a field subclass
Writing a
FileField
subclass
Custom template tags and filters
Code layout
Writing custom template filters
Writing custom template tags
Writing a custom storage system
Deploying Django
How to deploy with WSGI
How to use Django with FastCGI, SCGI, or AJP
Error reporting
Email reports
Filtering error reports
Providing initial data for models
Providing initial data with fixtures
Providing initial SQL data
Running Django on Jython
Installing Jython
Creating a servlet container
Installing Django
Installing Jython platform support libraries
Differences with Django on Jython
Integrating Django with a legacy database
Give Django your database parameters
Auto-generate the models
Install the core Django tables
Test and tweak
Outputting CSV with Django
Using the Python CSV library
Using the template system
Other text-based formats
Outputting PDFs with Django
Install ReportLab
Write your view
Complex PDFs
Further resources
Other formats
Managing static files
Using
django.contrib.staticfiles
Referring to static files in templates
Serving static files in development
Serving static files in production
Upgrading from
django-staticfiles
Learn more
Django FAQ
FAQ: General
Why does this project exist?
What does “Django” mean, and how do you pronounce it?
Is Django stable?
Does Django scale?
Who’s behind this?
Which sites use Django?
Django appears to be a MVC framework, but you call the Controller the “view”, and the View the “template”. How come you don’t use the standard names?
<Framework X> does <feature Y> – why doesn’t Django?
Why did you write all of Django from scratch, instead of using other Python libraries?
Is Django a content-management-system (CMS)?
How can I download the Django documentation to read it offline?
Where can I find Django developers for hire?
FAQ: Installation
How do I get started?
What are Django’s prerequisites?
Do I lose anything by using Python 2.6 versus newer Python versions, such as Python 2.7?
What Python version can I use with Django?
Can I use Django with Python 3?
Will Django run under shared hosting (like TextDrive or Dreamhost)?
Should I use the stable version or development version?
FAQ: Using Django
Why do I get an error about importing DJANGO_SETTINGS_MODULE?
I can’t stand your template language. Do I have to use it?
Do I have to use your model/database layer?
How do I use image and file fields?
How do I make a variable available to all my templates?
FAQ: Getting Help
How do I do X? Why doesn’t Y work? Where can I go to get help?
Why hasn’t my message appeared on django-users?
Nobody on django-users answered my question! What should I do?
I think I’ve found a bug! What should I do?
I think I’ve found a security problem! What should I do?
FAQ: Databases and models
How can I see the raw SQL queries Django is running?
Can I use Django with a pre-existing database?
If I make changes to a model, how do I update the database?
Do Django models support multiple-column primary keys?
How do I add database-specific options to my CREATE TABLE statements, such as specifying MyISAM as the table type?
Why is Django leaking memory?
FAQ: The admin
I can’t log in. When I enter a valid username and password, it just brings up the login page again, with no error messages.
I can’t log in. When I enter a valid username and password, it brings up the login page again, with a “Please enter a correct username and password” error.
How can I prevent the cache middleware from caching the admin site?
How do I automatically set a field’s value to the user who last edited the object in the admin?
How do I limit admin access so that objects can only be edited by the users who created them?
My admin-site CSS and images showed up fine using the development server, but they’re not displaying when using mod_wsgi.
My “list_filter” contains a ManyToManyField, but the filter doesn’t display.
Some objects aren’t appearing in the admin.
How can I customize the functionality of the admin interface?
The dynamically-generated admin site is ugly! How can I change it?
What browsers are supported for using the admin?
FAQ: Contributing code
How can I get started contributing code to Django?
I submitted a bug fix in the ticket system several weeks ago. Why are you ignoring my patch?
When and how might I remind the core team of a patch I care about?
But I’ve reminded you several times and you keep ignoring my patch!
Troubleshooting
Problems running django-admin.py
API Reference
Class-based views
Base views
Generic display views
Generic editing views
Generic date views
Class-based views mixins
Class-based generic views - flattened index
Specification
Base vs Generic views
Clickjacking Protection
An example of clickjacking
Preventing clickjacking
How to use it
Limitations
contrib
packages
The Django admin site
django.contrib.auth
User
Anonymous users
Permission
Group
Login and logout signals
Authentication backends
Django’s comments framework
The contenttypes framework
Cross Site Request Forgery protection
Databrowse
The flatpages app
django.contrib.formtools
GeoDjango
django.contrib.humanize
The “local flavor” add-ons
django.contrib.markup
The messages framework
The redirects app
The sitemap framework
The “sites” framework
The staticfiles app
The syndication feed framework
django.contrib.webdesign
admin
auth
comments
contenttypes
csrf
flatpages
formtools
gis
humanize
localflavor
markup
messages
redirects
sessions
sites
sitemaps
syndication
webdesign
Other add-ons
Databases
PostgreSQL notes
MySQL notes
SQLite notes
Oracle notes
Using a 3rd-party database backend
django-admin.py and manage.py
Usage
Available commands
Commands provided by applications
Default options
Common options
Extra niceties
Running management commands from your code
Output redirection
Django Exceptions
Django-specific Exceptions
Database Exceptions
Transaction Exceptions
Python Exceptions
File handling
The
File
object
File storage API
Forms
The Forms API
Form fields
Widgets
Form and field validation
Middleware
Available middleware
Models
Model field reference
Related objects reference
Model
Meta
options
Model instance reference
QuerySet API reference
Request and response objects
Quick overview
HttpRequest objects
UploadedFile objects
QueryDict objects
HttpResponse objects
StreamingHttpResponse objects
TemplateResponse and SimpleTemplateResponse
SimpleTemplateResponse objects
TemplateResponse objects
The rendering process
Using TemplateResponse and SimpleTemplateResponse
Settings
Available settings
Deprecated settings
Signals
Model signals
Management signals
Request/response signals
Test signals
Database Wrappers
Templates
Built-in template tags and filters
The Django template language: For Python programmers
Unicode data
Creating the database
General string handling
Models
The database API
Templates
Email
Form submission
django.core.urlresolvers
utility functions
reverse()
reverse_lazy()
resolve()
get_script_prefix()
django.conf.urls
utility functions
patterns()
url()
include()
handler403
handler404
handler500
Django Utils
django.utils.cache
django.utils.datastructures
django.utils.dateparse
django.utils.decorators
django.utils.encoding
django.utils.feedgenerator
django.utils.functional
django.utils.html
django.utils.http
django.utils.safestring
django.utils.text
django.utils.translation
django.utils.timezone
django.utils.tzinfo
Validators
Writing validators
How validators are run
Built-in validators
Meta-documentation and miscellany
API stability
What “stable” means
Stable APIs
Exceptions
Design philosophies
Overall
Models
Database API
URL design
Template system
Views
Third-party distributions of Django
For distributors
Glossary
Release notes
Final releases
1.6 release
1.5 release
1.4 release
1.3 release
1.2 release
1.1 release
1.0 release
Pre-1.0 releases
Development releases
Django 1.5 beta release notes
Django 1.5 release notes - UNDER DEVELOPMENT
Django 1.4 beta release notes
Django 1.4 alpha release notes
Django 1.3 beta 1 release notes
Django 1.3 alpha 1 release notes
Django 1.2 RC 1 release notes
Django 1.2 beta 1 release notes
Django 1.2 alpha 1 release notes
Django 1.1 RC 1 release notes
Django 1.1 beta 1 release notes
Django 1.1 alpha 1 release notes
Django 1.0 beta 2 release notes
Django 1.0 beta 1 release notes
Django 1.0 alpha 2 release notes
Django 1.0 alpha release notes
Django internals
Contributing to Django
Advice for new contributors
Reporting bugs and requesting features
Triaging tickets
Writing code
Writing documentation
Localizing Django
Committing code
Django committers
The original team
Current developers
Developers Emeritus
Django’s security policies
Reporting security issues
Supported versions
How Django discloses security issues
Who receives advance notification
Requesting notifications
Django’s release process
Official releases
Supported versions
Release process
Django Deprecation Timeline
1.4
1.5
1.6
1.7
2.0
The Django source code repository
High-level overview
The master branch
Other branches
Tags
Indices, glossary and tables
¶
Index
Module Index
Glossary
Table Of Contents
Django documentation contents
Indices, glossary and tables
Browse
Next:
Django documentation
You are here:
Django 1.6.dev20121223155050 documentation
Django documentation contents
This Page
Show Source
Quick search
Enter search terms or a module, class or function name.
Last update:
Dec 23, 2012
up
|
next
»