utils.translation.deactivate()

deactivate() [source] Deactivates the currently active translation object so that further _ calls will resolve against the default translation object, again.

utils.translation.check_for_language()

check_for_language(lang_code) [source] Checks whether there is a global language file for the given language code (e.g. ‘fr’, ‘pt_BR’). This is used to decide whether a user-provided language is available.

utils.translation.gettext_lazy()

gettext_lazy(message)

utils.timezone.localtime()

localtime(value, timezone=None) [source] Converts an aware datetime to a different time zone, by default the current time zone. This function doesn’t work on naive datetimes; use make_aware() instead.

utils.timezone.now()

now() [source] Returns a datetime that represents the current point in time. Exactly what’s returned depends on the value of USE_TZ: If USE_TZ is False, this will be a naive datetime (i.e. a datetime without an associated timezone) that represents the current time in the system’s local timezone. If USE_TZ is True, this will be an aware datetime representing the current time in UTC. Note that now() will always return times in UTC regardless of the value of TIME_ZONE; you can use localtime() t

utils.timezone.make_aware()

make_aware(value, timezone=None, is_dst=None) [source] Returns an aware datetime that represents the same point in time as value in timezone, value being a naive datetime. If timezone is set to None, it defaults to the current time zone. When pytz is installed, the exception pytz.AmbiguousTimeError will be raised if you try to make value aware during a DST transition where the same time occurs twice (when reverting from DST). Setting is_dst to True or False will avoid the exception by choosi

utils.timezone.make_naive()

make_naive(value, timezone=None) [source] Returns an naive datetime that represents in timezone the same point in time as value, value being an aware datetime. If timezone is set to None, it defaults to the current time zone.

utils.timezone.override()

override(timezone) [source] This is a Python context manager that sets the current time zone on entry with activate(), and restores the previously active time zone on exit. If the timezone argument is None, the current time zone is unset on entry with deactivate() instead. override is also usable as a function decorator.

utils.timezone.get_fixed_timezone()

get_fixed_timezone(offset) [source] Returns a tzinfo instance that represents a time zone with a fixed offset from UTC. offset is a datetime.timedelta or an integer number of minutes. Use positive values for time zones east of UTC and negative values for west of UTC.

utils.timezone.get_default_timezone_name()

get_default_timezone_name() [source] Returns the name of the default time zone.