utils.encoding.force_str()
  • References/Python/Django/API/Django Utils

force_str(s, encoding='utf-8', strings_only=False, errors='strict') Alias of force_bytes() on Python 2 and

2025-01-10 15:47:30
utils.encoding.is_protected_type()
  • References/Python/Django/API/Django Utils

is_protected_type(obj) [source] Determine if the object instance is of a protected type.

2025-01-10 15:47:30
utils.cache.get_cache_key()
  • References/Python/Django/API/Django Utils

get_cache_key(request, key_prefix=None) [source] Returns a cache key based on the request

2025-01-10 15:47:30
utils.translation.pgettext_lazy()
  • References/Python/Django/API/Django Utils

pgettext_lazy(context, message) Same as the non-lazy versions above, but using lazy execution. See

2025-01-10 15:47:30
utils.html.strip_tags()
  • References/Python/Django/API/Django Utils

strip_tags(value) [source] Tries to remove anything that looks like an HTML tag from the

2025-01-10 15:47:30
utils.safestring.SafeText
  • References/Python/Django/API/Django Utils

class SafeText [source] A str (in Python 3) or unicode (in Python

2025-01-10 15:47:30
utils.http.cookie_date()
  • References/Python/Django/API/Django Utils

cookie_date(epoch_seconds=None) [source] Formats the time to ensure compatibility with Netscape’s

2025-01-10 15:47:30
utils.feedgenerator.Rss201rev2Feed
  • References/Python/Django/API/Django Utils

class Rss201rev2Feed(RssFeed) [source] Spec:

2025-01-10 15:47:30
utils.feedgenerator.SyndicationFeed.write()
  • References/Python/Django/API/Django Utils

write(outfile, encoding) [source] Outputs the feed in the given encoding to outfile

2025-01-10 15:47:30
utils.translation.get_language_from_request()
  • References/Python/Django/API/Django Utils

get_language_from_request(request, check_path=False) [source] Analyzes the request to find

2025-01-10 15:47:30