flask

A microframework based on Werkzeug. It’s extensively documented and follows best practice patterns.

Functions

after_this_request(f) Executes a function after this request.
copy_current_request_context(f) A helper function that decorates a function to retain the current request context.
escape((s) -> markup) Convert the characters &, <, >, ‘, and ” in string s to HTML-safe sequences.
flash(message[, category]) Flashes a message to the next request.
get_flashed_messages([with_categories, ...]) Pulls all flashed messages from the session and returns them.
get_template_attribute(template_name, attribute) Loads a macro (or variable) a template exports.
has_app_context() Works like has_request_context() but for the application context.
has_request_context() If you have code that wants to test if a request context is there or not this function can be used.
jsonify(*args, **kwargs) This function wraps dumps() to add a few enhancements that make life easier.
make_response(*args) Sometimes it is necessary to set additional headers in a view.
redirect(location[, code, Response]) Returns a response object (a WSGI application) that, if called, redirects the client to the target location.
render_template(template_name_or_list, **context) Renders a template from the template folder with the given context.
render_template_string(source, **context) Renders a template from the given template source string with the given context.
safe_join(directory, filename) Safely join directory and filename.
send_file(filename_or_fp[, mimetype, ...]) Sends the contents of a file to the client.
send_from_directory(directory, filename, ...) Send a file from a given directory with send_file().
stream_with_context(generator_or_function) Request contexts disappear when the response is started on the server.
url_for(endpoint, **values) Generates a URL to the given endpoint with the method provided.

Classes

Blueprint(name, import_name[, ...]) Represents a blueprint.
Config(root_path[, defaults]) Works exactly like a dict but provides ways to fill it from files or special dictionaries.
Flask(import_name[, static_path, ...]) The flask object implements a WSGI application and acts as the central object.
Markup Marks a string as being safe for inclusion in HTML/XML output without needing to be escaped.
Request(environ[, populate_request, shallow]) The request object used by default in Flask.
Response([response, status, headers, ...]) The response object that is used by default in Flask.
Session alias of SecureCookieSession