admin.AdminSite.add_action()

AdminSite.add_action(action, name=None) [source] Some actions are best if they’re made available to any object in the admin site – the export action defined above would be a good candidate. You can make an action globally available using AdminSite.add_action(). For example: from django.contrib import admin admin.site.add_action(export_selected_objects) This makes the export_selected_objects action globally available as an action named “export_selected_objects”. You can explicitly give the

Managing static files (e.g. images, JavaScript, CSS)

Websites generally need to serve additional files such as images, JavaScript, or CSS. In Django, we refer to these files as “static files”. Django provides django.contrib.staticfiles to help you manage them. This page describes how you can serve these static files. Configuring static files Make sure that django.contrib.staticfiles is included in your INSTALLED_APPS. In your settings file, define STATIC_URL, for example: STATIC_URL = '/static/' In your templates, either hardcode the url lik

forms.BoundField.label

BoundField.label The label of the field. This is used in label_tag().

views.generic.dates.WeekMixin.get_next_week()

get_next_week(date) [source] Returns a date object containing the first day of the week after the date provided. This function can also return None or raise an Http404 exception, depending on the values of allow_empty and allow_future.

utils.translation.override()

override(language, deactivate=False) [source] A Python context manager that uses django.utils.translation.activate() to fetch the translation object for a given language, activates it as the translation object for the current thread and reactivates the previous active language on exit. Optionally, it can simply deactivate the temporary translation on exit with django.utils.translation.deactivate() if the deactivate argument is True. If you pass None as the language argument, a NullTranslatio

http.HttpRequest.readline()

HttpRequest.readline() [source]

http.HttpRequest.urlconf

HttpRequest.urlconf This will be used as the root URLconf for the current request, overriding the ROOT_URLCONF setting. See How Django processes a request for details. urlconf can be set to None to revert any changes made by previous middleware and return to using the ROOT_URLCONF. Changed in Django 1.9: Setting urlconf=None raised ImproperlyConfigured in older versions.

postgres.validators.RangeMaxValueValidator

class RangeMaxValueValidator(limit_value, message=None) [source] Validates that the upper bound of the range is not greater than limit_value.

gis.db.models.functions.Difference

class Difference(expr1, expr2, **extra) Availability: MySQL (≥ 5.6.1), PostGIS, Oracle, SpatiaLite Accepts two geographic fields or expressions and returns the geometric difference, that is the part of geometry A that does not intersect with geometry B. Changed in Django 1.10: MySQL support was added.

gis.gdal.GeometryCollection.add()

add(geom) Adds a geometry to this geometry collection. Not applicable to other geometry types.