views.generic.list.MultipleObjectMixin.get_paginate_by()

get_paginate_by(queryset) Returns the number of items to paginate by, or None for no pagination. By default this simply returns the value of paginate_by.

views.generic.dates.BaseDateListView.allow_empty

allow_empty A boolean specifying whether to display the page if no objects are available. If this is True and no objects are available, the view will display an empty page instead of raising a 404. This is identical to django.views.generic.list.MultipleObjectMixin.allow_empty, except for the default value, which is False.

core.files.storage.Storage.url()

url(name) [source] Returns the URL where the contents of the file referenced by name can be accessed. For storage systems that don’t support access by URL this will raise NotImplementedError instead.

gis.gdal.Polygon.centroid

centroid Returns a Point representing the centroid of this polygon.

core.mail.mail_managers()

mail_managers(subject, message, fail_silently=False, connection=None, html_message=None) [source] django.core.mail.mail_managers() is just like mail_admins(), except it sends an email to the site managers, as defined in the MANAGERS setting.

Installing PostGIS

PostGIS adds geographic object support to PostgreSQL, turning it into a spatial database. GEOS, PROJ.4 and GDAL should be installed prior to building PostGIS. You might also need additional libraries, see PostGIS requirements. The psycopg2 module is required for use as the database adapter when using GeoDjango with PostGIS. On Debian/Ubuntu, you are advised to install the following packages: postgresql-x.x, postgresql-x.x-postgis, postgresql-server-dev-x.x, python-psycopg2 (x.x matching the Pos

middleware.exception.ExceptionMiddleware

class ExceptionMiddleware New in Django 1.10. Catches exceptions raised during the request/response cycle and returns the appropriate response. Http404 is processed by handler404 (or a more friendly debug page if DEBUG=True). PermissionDenied is processed by handler403. MultiPartParserError is processed by handler400. SuspiciousOperation is processed by handler400 (or a more friendly debug page if DEBUG=True). Any other exception is processed by handler500 (or a more friendly debug pag

forms.formsets.BaseFormSet.can_delete

BaseFormSet.can_delete Default: False Lets you create a formset with the ability to select forms for deletion: >>> from django.forms import formset_factory >>> from myapp.forms import ArticleForm >>> ArticleFormSet = formset_factory(ArticleForm, can_delete=True) >>> formset = ArticleFormSet(initial=[ ... {'title': 'Article #1', 'pub_date': datetime.date(2008, 5, 10)}, ... {'title': 'Article #2', 'pub_date': datetime.date(2008, 5, 11)}, ... ]) >&

forms.formsets.BaseFormSet

class BaseFormSet [source] A formset is a layer of abstraction to work with multiple forms on the same page. It can be best compared to a data grid. Let’s say you have the following form: >>> from django import forms >>> class ArticleForm(forms.Form): ... title = forms.CharField() ... pub_date = forms.DateField() You might want to allow the user to create several articles at once. To create a formset out of an ArticleForm you would do: >>> from django.form

db.models.ManyToManyField.db_constraint

ManyToManyField.db_constraint Controls whether or not constraints should be created in the database for the foreign keys in the intermediary table. The default is True, and that’s almost certainly what you want; setting this to False can be very bad for data integrity. That said, here are some scenarios where you might want to do this: You have legacy data that is not valid. You’re sharding your database. It is an error to pass both db_constraint and through.