core.files.uploadedfile.UploadedFile.content_type

UploadedFile.content_type The content-type header uploaded with the file (e.g. text/plain or application/pdf). Like any data supplied by the user, you shouldn’t trust that the uploaded file is actually this type. You’ll still need to validate that the file contains the content that the content-type header claims – “trust but verify.”

core.paginator.Paginator.page()

Paginator.page(number) [source] Returns a Page object with the given 1-based index. Raises InvalidPage if the given page number doesn’t exist.

utils.cache.patch_response_headers()

patch_response_headers(response, cache_timeout=None) [source] Adds some useful headers to the given HttpResponse object: ETag Last-Modified Expires Cache-Control Each header is only added if it isn’t already set. cache_timeout is in seconds. The CACHE_MIDDLEWARE_SECONDS setting is used by default.

utils.translation.get_language_from_request()

get_language_from_request(request, check_path=False) [source] Analyzes the request to find what language the user wants the system to show. Only languages listed in settings.LANGUAGES are taken into account. If the user requests a sublanguage where we have a main language, we send out the main language. If check_path is True, the function first checks the requested URL for whether its path begins with a language code listed in the LANGUAGES setting.

template.loader.select_template()

select_template(template_name_list, using=None) [source] select_template() is just like get_template(), except it takes a list of template names. It tries each name in order and returns the first template that exists. If loading a template fails, the following two exceptions, defined in django.template, may be raised:

views.generic.list.MultipleObjectMixin.context_object_name

context_object_name Designates the name of the variable to use in the context.

gis.geos.MultiPoint

class MultiPoint(*args, **kwargs) MultiPoint objects may be instantiated by passing in Point objects as arguments, or a single sequence of Point objects: >>> mp = MultiPoint(Point(0, 0), Point(1, 1)) >>> mp = MultiPoint( (Point(0, 0), Point(1, 1)) ) Changed in Django 1.10: In previous versions, an empty MultiPoint couldn’t be instantiated.

http.HttpRequest.content_params

HttpRequest.content_params New in Django 1.10. A dictionary of key/value parameters included in the CONTENT_TYPE header.

forms.TimeInput.format

format The format in which this field’s initial value will be displayed. If no format argument is provided, the default format is the first format found in TIME_INPUT_FORMATS and respects Format localization. For the treatment of microseconds, see DateTimeInput.

forms.Widget

class Widget(attrs=None) [source] This abstract class cannot be rendered, but provides the basic attribute attrs. You may also implement or override the render() method on custom widgets. attrs A dictionary containing HTML attributes to be set on the rendered widget. >>> from django import forms >>> name = forms.TextInput(attrs={'size': 10, 'title': 'Your name',}) >>> name.render('name', 'A name') '<input title="Your name" type="text" name="name" value="A nam