admin.AdminSite.index_title

AdminSite.index_title The text to put at the top of the admin index page (a string). By default, this is “Site administration”.

forms.Form.error_css_class

Form.error_css_class

db.models.GenericIPAddressField.protocol

GenericIPAddressField.protocol Limits valid inputs to the specified protocol. Accepted values are 'both' (default), 'IPv4' or 'IPv6'. Matching is case insensitive.

Writing your first Django app, part 2

This tutorial begins where Tutorial 1 left off. We’ll setup the database, create your first model, and get a quick introduction to Django’s automatically-generated admin site. Database setup Now, open up mysite/settings.py. It’s a normal Python module with module-level variables representing Django settings. By default, the configuration uses SQLite. If you’re new to databases, or you’re just interested in trying Django, this is the easiest choice. SQLite is included in Python, so you won’t nee

gis.gdal.Field.as_string()

as_string() Returns the value of the field as a string: >>> city['Name'].as_string() 'Pueblo'

Security in Django

This document is an overview of Django’s security features. It includes advice on securing a Django-powered site. Cross site scripting (XSS) protection XSS attacks allow a user to inject client side scripts into the browsers of other users. This is usually achieved by storing the malicious scripts in the database where it will be retrieved and displayed to other users, or by getting users to click a link which will cause the attacker’s JavaScript to be executed by the user’s browser. However, X

db.models.Field

class Field [source] Field is an abstract class that represents a database table column. Django uses fields to create the database table (db_type()), to map Python types to database (get_prep_value()) and vice-versa (from_db_value()). A field is thus a fundamental piece in different Django APIs, notably, models and querysets. In models, a field is instantiated as a class attribute and represents a particular table column, see Models. It has attributes such as null and unique, and methods tha

Aggregation

The topic guide on Django’s database-abstraction API described the way that you can use Django queries that create, retrieve, update and delete individual objects. However, sometimes you will need to retrieve values that are derived by summarizing or aggregating a collection of objects. This topic guide describes the ways that aggregate values can be generated and returned using Django queries. Throughout this guide, we’ll refer to the following models. These models are used to track the invent

core.paginator.Page.next_page_number()

Page.next_page_number() [source] Returns the next page number. Raises InvalidPage if next page doesn’t exist.

db.models.CASCADE

CASCADE [source] Cascade deletes. Django emulates the behavior of the SQL constraint ON DELETE CASCADE and also deletes the object containing the ForeignKey.