utils.http.urlquote_plus()

urlquote_plus(url, safe='') [source] A version of Python’s urllib.quote_plus() function that can operate on unicode strings. The url is first UTF-8 encoded before quoting. The returned string can safely be used as part of an argument to a subsequent iri_to_uri() call without double-quoting occurring. Employs lazy execution.

utils.log.AdminEmailHandler.send_mail()

send_mail(subject, message, *args, **kwargs) [source] Sends emails to admin users. To customize this behavior, you can subclass the AdminEmailHandler class and override this method.

utils.http.urlsafe_base64_encode()

urlsafe_base64_encode(s) [source] Encodes a bytestring in base64 for use in URLs, stripping any trailing equal signs.

utils.http.urlsafe_base64_decode()

urlsafe_base64_decode(s) [source] Decodes a base64 encoded string, adding back any trailing equal signs that might have been stripped.

utils.http.int_to_base36()

int_to_base36(i) [source] Converts a positive integer to a base 36 string. On Python 2 i must be smaller than sys.maxint.

utils.http.cookie_date()

cookie_date(epoch_seconds=None) [source] Formats the time to ensure compatibility with Netscape’s cookie standard. Accepts a floating point number expressed in seconds since the epoch in UTC–such as that outputted by time.time(). If set to None, defaults to the current time. Outputs a string in the format Wdy, DD-Mon-YYYY HH:MM:SS GMT.

utils.http.urlencode()

urlencode(query, doseq=0) [source] A version of Python’s urllib.urlencode() function that can operate on unicode strings. The parameters are first cast to UTF-8 encoded strings and then encoded as per normal.

utils.http.urlquote()

urlquote(url, safe='/') [source] A version of Python’s urllib.quote() function that can operate on unicode strings. The url is first UTF-8 encoded before quoting. The returned string can safely be used as part of an argument to a subsequent iri_to_uri() call without double-quoting occurring. Employs lazy execution.

utils.http.http_date()

http_date(epoch_seconds=None) [source] Formats the time to match the RFC 1123 date format as specified by HTTP RFC 7231#section-7.1.1.1. Accepts a floating point number expressed in seconds since the epoch in UTC–such as that outputted by time.time(). If set to None, defaults to the current time. Outputs a string in the format Wdy, DD Mon YYYY HH:MM:SS GMT.

utils.http.base36_to_int()

base36_to_int(s) [source] Converts a base 36 string to an integer. On Python 2 the output is guaranteed to be an int and not a long.