Utilities
This module implements utility functions.
none
none
Compress ‘body’ at the given compress_level.
Return a list of (start, stop) indices from a Range header, or None.
Each (start, stop) tuple will be composed of two ints, which are suitable for use in a slicing operation. That is, the header “Range: bytes=3-6”, if applied against a Python string, is requesting resource[3:7]. This function will return the list [(3, 7)].
If this function returns an empty list, you should return HTTP 416.
Build a params dictionary from a query_string. If keep_blank_values is True (the default), keep values that are blank.
Create an absolute URL for the given path.
If script_name is None, request will be used to find a script_name, if available.
If base is None, request.base will be used (if available).
Finally, note that this function can be used to obtain an absolute URL for the current request path (minus the querystring) by passing no args. If you call url(qs=request.qs), you should get the original browser URL (assuming no internal redirections).
If relative is False the output will be an absolute URL (including the scheme, host, vhost, and script_name). If True, the output will instead be a URL that is relative to the current request path, perhaps including ‘..’ atoms. If relative is the string ‘server’, the output will instead be a URL that is relative to the server root; i.e., it will start with a slash.