Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé

Contenu du module « flask »

Liste des classes du module flask

Nom de la classe Description
Blueprint
Config Works exactly like a dict but provides ways to fill it from files [extrait de Config.__doc__]
Flask The flask object implements a WSGI application and acts as the central [extrait de Flask.__doc__]
Request The request object used by default in Flask. Remembers the [extrait de Request.__doc__]
Response The response object that is used by default in Flask. Works like the [extrait de Response.__doc__]

Liste des fonctions du module flask

Signature de la fonction Description
abort(code: 'int | BaseResponse', *args: 't.Any', **kwargs: 't.Any') -> 't.NoReturn' Raise an :exc:`~werkzeug.exceptions.HTTPException` for the given [extrait de abort.__doc__]
after_this_request(f: 'ft.AfterRequestCallable[t.Any]') -> 'ft.AfterRequestCallable[t.Any]' Executes a function after this request. This is useful to modify [extrait de after_this_request.__doc__]
copy_current_request_context(f: 'F') -> 'F' A helper function that decorates a function to retain the current [extrait de copy_current_request_context.__doc__]
flash(message: 'str', category: 'str' = 'message') -> 'None' Flashes a message to the next request. In order to remove the [extrait de flash.__doc__]
get_flashed_messages(with_categories: 'bool' = False, category_filter: 't.Iterable[str]' = ()) -> 'list[str] | list[tuple[str, str]]' Pulls all flashed messages from the session and returns them. [extrait de get_flashed_messages.__doc__]
get_template_attribute(template_name: 'str', attribute: 'str') -> 't.Any' Loads a macro (or variable) a template exports. This can be used to [extrait de get_template_attribute.__doc__]
has_app_context() -> 'bool' Works like :func:`has_request_context` but for the application [extrait de has_app_context.__doc__]
has_request_context() -> 'bool' If you have code that wants to test if a request context is there or [extrait de has_request_context.__doc__]
jsonify(*args: 't.Any', **kwargs: 't.Any') -> 'Response' Serialize the given arguments as JSON, and return a [extrait de jsonify.__doc__]
make_response(*args: 't.Any') -> 'Response' Sometimes it is necessary to set additional headers in a view. Because [extrait de make_response.__doc__]
redirect(location: 'str', code: 'int' = 302, Response: 'type[BaseResponse] | None' = None) -> 'BaseResponse' Create a redirect response object. [extrait de redirect.__doc__]
render_template(template_name_or_list: 'str | Template | list[str | Template]', **context: 't.Any') -> 'str' Render a template by name with the given context. [extrait de render_template.__doc__]
render_template_string(source: 'str', **context: 't.Any') -> 'str' Render a template from the given source string with the given [extrait de render_template_string.__doc__]
send_file(path_or_file: 'os.PathLike[t.AnyStr] | str | t.BinaryIO', mimetype: 'str | None' = None, as_attachment: 'bool' = False, download_name: 'str | None' = None, conditional: 'bool' = True, etag: 'bool | str' = True, last_modified: 'datetime | int | float | None' = None, max_age: 'None | (int | t.Callable[[str | None], int | None])' = None) -> 'Response' Send the contents of a file to the client. [extrait de send_file.__doc__]
send_from_directory(directory: 'os.PathLike[str] | str', path: 'os.PathLike[str] | str', **kwargs: 't.Any') -> 'Response' Send a file from within a directory using :func:`send_file`. [extrait de send_from_directory.__doc__]
stream_template(template_name_or_list: 'str | Template | list[str | Template]', **context: 't.Any') -> 't.Iterator[str]' Render a template by name with the given context as a stream. [extrait de stream_template.__doc__]
stream_template_string(source: 'str', **context: 't.Any') -> 't.Iterator[str]' Render a template from the given source string with the given [extrait de stream_template_string.__doc__]
stream_with_context(generator_or_function: 't.Iterator[t.AnyStr] | t.Callable[..., t.Iterator[t.AnyStr]]') -> 't.Iterator[t.AnyStr] | t.Callable[[t.Iterator[t.AnyStr]], t.Iterator[t.AnyStr]]' Request contexts disappear when the response is started on the server. [extrait de stream_with_context.__doc__]
url_for(endpoint: 'str', *, _anchor: 'str | None' = None, _method: 'str | None' = None, _scheme: 'str | None' = None, _external: 'bool | None' = None, **values: 't.Any') -> 'str' Generate a URL to the given endpoint with the given values. [extrait de url_for.__doc__]

Liste des variables globales du module flask

Nom de la variable globale Valeur
annotations _Feature((3, 7, 0, 'beta', 1), None, 16777216)
appcontext_popped <blinker.base.NamedSignal object at 0x0000020D9ECAB850; 'appcontext-popped'>
appcontext_pushed <blinker.base.NamedSignal object at 0x0000020D9ED1E250; 'appcontext-pushed'>
appcontext_tearing_down <blinker.base.NamedSignal object at 0x0000020D9ED1E140; 'appcontext-tearing-down'>
before_render_template <blinker.base.NamedSignal object at 0x0000020D9EC3AD50; 'before-render-template'>
current_app
g
got_request_exception <blinker.base.NamedSignal object at 0x0000020D9EE2C950; 'got-request-exception'>
message_flashed <blinker.base.NamedSignal object at 0x0000020D9ECAB950; 'message-flashed'>
request
request_finished <blinker.base.NamedSignal object at 0x0000020D9ECE1350; 'request-finished'>
request_started <blinker.base.NamedSignal object at 0x0000020D9EC3AE90; 'request-started'>
request_tearing_down <blinker.base.NamedSignal object at 0x0000020D9ECE1480; 'request-tearing-down'>
session
template_rendered <blinker.base.NamedSignal object at 0x0000020D9ED096A0; 'template-rendered'>


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé