core.signing.TimestampSigner.sign()

sign(value) [source] Sign value and append current timestamp to it.

core.signing.TimestampSigner

class TimestampSigner(key=None, sep=':', salt=None) [source] sign(value) [source] Sign value and append current timestamp to it. unsign(value, max_age=None) [source] Checks if value was signed less than max_age seconds ago, otherwise raises SignatureExpired. The max_age parameter can accept an integer or a datetime.timedelta object.

core.signing.Signer

class Signer(key=None, sep=':', salt=None) [source] Returns a signer which uses key to generate signatures and sep to separate values. sep cannot be in the URL safe base64 alphabet. This alphabet contains alphanumeric characters, hyphens, and underscores.

core.signing.loads()

loads(string, key=None, salt='django.core.signing', max_age=None) [source] Reverse of dumps(), raises BadSignature if signature fails. Checks max_age (in seconds) if given.

core.signing.dumps()

dumps(obj, key=None, salt='django.core.signing', compress=False) [source] Returns URL-safe, sha1 signed base64 compressed JSON string. Serialized object is signed using TimestampSigner.

core.serializers.json.DjangoJSONEncoder

class django.core.serializers.json.DjangoJSONEncoder The JSON serializer uses DjangoJSONEncoder for encoding. A subclass of JSONEncoder, it handles these additional types:

core.serializers.get_serializer()

django.core.serializers.get_serializer(format) You can also use a serializer object directly: XMLSerializer = serializers.get_serializer("xml") xml_serializer = XMLSerializer() xml_serializer.serialize(queryset) data = xml_serializer.getvalue() This is useful if you want to serialize data directly to a file-like object (which includes an HttpResponse): with open("file.xml", "w") as out: xml_serializer.serialize(SomeModel.objects.all(), stream=out) Note Calling get_serializer() with an

core.paginator.Paginator.page_range

Paginator.page_range A 1-based range iterator of page numbers, e.g. yielding [1, 2, 3, 4]. Changed in Django 1.9: In older versions, page_range returned a list instead of an iterator.

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.

core.paginator.Paginator.num_pages

Paginator.num_pages The total number of pages.