Undocumented
Function | base36_to_int |
Convert a base 36 string to an int. Raise ValueError if the input won't fit into an int. |
Function | http_date |
Format the time to match the RFC1123 date format as specified by HTTP RFC7231 section 7.1.1.1. |
Function | int_to_base36 |
Convert an integer to a base36 string. |
Function | urlencode |
A version of Python's urllib.parse.urlencode() function that can operate on MultiValueDict and non-string values. |
Function | urlsafe_base64_decode |
Decode a base64 encoded string. Add back any trailing equal signs that might have been stripped. |
Function | urlsafe_base64_encode |
Encode a bytestring to a base64 string for use in URLs. Strip any trailing equal signs. |
Constant | ASCTIME_DATE |
Undocumented |
Constant | ETAG_MATCH |
Undocumented |
Constant | MONTHS |
Undocumented |
Constant | RFC1123_DATE |
Undocumented |
Constant | RFC3986_GENDELIMS |
Undocumented |
Constant | RFC3986_SUBDELIMS |
Undocumented |
Constant | RFC850_DATE |
Undocumented |
Function | _url_has_allowed_host_and_scheme |
Undocumented |
Function | _urlparse |
No summary |
Function | _urlsplit |
No summary |
Function | escape_leading_slashes |
If redirecting to an absolute path (two leading slashes), a slash must be escaped to prevent browsers from handling the path as schemaless and redirecting to another host. |
Function | is_same_domain |
Return True if the host is either an exact match or a match to the wildcard pattern. |
Function | parse_etags |
Parse a string of ETags given in an If-None-Match or If-Match header as defined by RFC 7232. Return a list of quoted ETags, or ['*'] if all ETags should be matched. |
Function | parse_http_date |
Parse a date format as specified by HTTP RFC7231 section 7.1.1.1. |
Function | parse_http_date_safe |
Same as parse_http_date, but return None if the input is invalid. |
Function | quote_etag |
If the provided string is already a quoted ETag, return it. Otherwise, wrap the string in quotes, making it a strong ETag. |
Function | url_has_allowed_host_and_scheme |
Return True if the url uses an allowed host and a safe scheme. |
Constant | __D |
Undocumented |
Constant | __D2 |
Undocumented |
Constant | __M |
Undocumented |
Constant | __T |
Undocumented |
Constant | __Y |
Undocumented |
Constant | __Y2 |
Undocumented |
Format the time to match the RFC1123 date format as specified by HTTP RFC7231 section 7.1.1.1.
epoch_seconds
is a floating point number expressed in seconds since the
epoch, in UTC - such as that outputted by time.time(). If set to None, it
defaults to the current time.
Output a string in the format 'Wdy, DD Mon YYYY HH:MM:SS GMT'.
Undocumented
Value |
|
Undocumented
Value |
|
Return True if the host is either an exact match or a match to the wildcard pattern.
Any pattern beginning with a period matches a domain and all of its subdomains. (e.g. .example.com matches example.com and foo.example.com). Anything else is an exact string match.
Parse a date format as specified by HTTP RFC7231 section 7.1.1.1.
The three formats allowed by the RFC are accepted, even if only the first one is still in widespread use.
Return an integer expressed in seconds since the epoch, in UTC.
Return True if the url uses an allowed host and a safe scheme.
Always return False on an empty url.
If require_https is True, only 'https' will be considered a valid scheme, as opposed to 'http' and 'https' with the default, False.
Note: "True" doesn't entail that a URL is "safe". It may still be e.g. quoted incorrectly. Ensure to also use django.utils.encoding.iri_to_uri() on the path component of untrusted URLs.