Expand description
This module implements various helpers.
Traits§
- Path
Bound - Path bound trait.
Functions§
- abort
- One helper function that can be used to return HTTP Error inside a view function.
- escape
- Replace special characters “&”, “<”, “>” and (“) to HTML-safe characters.
- redirect
- Returns a response that redirects the client to the target location.
- safe_
join - Safely join directory and filename, otherwise this returns None.
- send_
file - Sends the contents of a file to the client. Please never pass filenames to this
function from user sources without checking them first. Set
as_attachment
totrue
if you want to send this file with aContent-Disposition: attachment
header. This will returnNotFound
if filepath is not one file. - send_
file_ range - Sends the contents of a file to the client, supporting HTTP Range requests, so it allows only partial files
to be requested and sent. This doesn’t support multiranges at the moment.
Please never pass filenames to this
function from user sources without checking them first. Set
as_attachment
totrue
if you want to send this file with aContent-Disposition: attachment
header. This will returnNotFound
if filepath is not one file. - send_
from_ directory - Send a file from a given directory with
send_file
. This is a secure way to quickly expose static files from an folder. This will guess the mimetype for you. - send_
from_ directory_ range - Send a file from a given directory with
send_file
, supporting HTTP Range requests, so it allows only partial files to be requested and sent. This doesn’t support multiranges at the moment. This is a secure way to quickly expose static files from an folder. This will guess the mimetype for you.