sessions.backends.base.SessionBase.delete_test_cookie()

delete_test_cookie() Deletes the test cookie. Use this to clean up after yourself.

sessions.base_session.AbstractBaseSession.get_decoded()

get_decoded() Returns decoded session data. Decoding is performed by the session store class.

sessions.backends.base.SessionBase.get_expiry_age()

get_expiry_age() Returns the number of seconds until this session expires. For sessions with no custom expiration (or those set to expire at browser close), this will equal SESSION_COOKIE_AGE. This function accepts two optional keyword arguments: modification: last modification of the session, as a datetime object. Defaults to the current time. expiry: expiry information for the session, as a datetime object, an int (in seconds), or None. Defaults to the value stored in the session by set_

shortcuts.get_list_or_404()

get_list_or_404(klass, *args, **kwargs) [source] Returns the result of filter() on a given model manager cast to a list, raising Http404 if the resulting list is empty.

sitemaps.Sitemap.location

location [source] Optional. Either a method or attribute. If it’s a method, it should return the absolute path for a given object as returned by items(). If it’s an attribute, its value should be a string representing an absolute path to use for every object returned by items(). In both cases, “absolute path” means a URL that doesn’t include the protocol or domain. Examples: Good: '/foo/bar/' Bad: 'example.com/foo/bar/' Bad: 'https://example.com/foo/bar/' If location isn’t provided, the

sitemaps.Sitemap.protocol

protocol Optional. This attribute defines the protocol ('http' or 'https') of the URLs in the sitemap. If it isn’t set, the protocol with which the sitemap was requested is used. If the sitemap is built outside the context of a request, the default is 'http'.

template.base.Origin

class Origin [source] name The path to the template as returned by the template loader. For loaders that read from the file system, this is the full path to the template. If the template is instantiated directly rather than through a template loader, this is a string value of <unknown_source>. template_name The relative path to the template as passed into the template loader. If the template is instantiated directly rather than through a template loader, this is None.

views.generic.dates.MonthMixin

class MonthMixin [source] A mixin that can be used to retrieve and provide parsing information for a month component of a date. Methods and Attributes month_format The strftime() format to use when parsing the month. By default, this is '%b'. month Optional The value for the month, as a string. By default, set to None, which means the month will be determined using other means. get_month_format() [source] Returns the strftime() format to use when parsing the month. Returns mon

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

views.i18n.JSONCatalog

class JSONCatalog [source] In order to use another client-side library to handle translations, you may want to take advantage of the JSONCatalog view. It’s similar to JavaScriptCatalog but returns a JSON response. See the documentation for JavaScriptCatalog to learn about possible values and use of the domain and packages attributes. The response format is as follows: { "catalog": { # Translations catalog }, "formats": { # Language formats for date, time, etc.