![]() ![]() The endpoint for Īfter_app_request(self, f: Callable, ForwardRef('Response')]) -> Callable, ForwardRef('Response')] Like :meth:`Flask.add_url_rule` but for a blueprint. Like Īdd_url_rule(self, rule: str, endpoint: Optional = None, view_func: Optional = None, provide_automatic_options: Optional = None, **options: Any) -> None Register a custom template test, available application wide. Like Īdd_app_template_test(self, f: Callable, name: Optional = None) -> None Register a custom template global, available application wide. ![]() Like Īdd_app_template_global(self, f: Callable, name: Optional = None) -> None Register a custom template filter, available application wide. Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées Signature de la méthodeĪdd_app_template_filter(self, f: Callable, name: Optional = None) -> None _init_(self, name: str, import_name: str, static_folder: Union = None, static_url_path: Optional = None, template_folder: Optional = None, url_prefix: Optional = None, subdomain: Optional = None, url_defaults: Optional = None, root_path: Optional = None, cli_group: Optional = ) The ``cli_group`` parameter controls the name of the group underĬonstructeur(s) Signature du constructeur In certain situations thisĪutomatic detection can fail, so the path can be specifiedīlueprints have a ``cli`` group to register nested CLI commands. :param root_path: By default, the blueprint will automatically set :param url_defaults: A dict of default values that blueprint routes :param subdomain: A subdomain that blueprint routes will match on by To make them distinct from the rest of the app's routes. :param url_prefix: A path to prepend to all of the blueprint's URLs, Blueprint templates have a lower precedence than those Blueprint templates are disabled byĭefault. The path is relative to theīlueprint's root path. :param template_folder: A folder with templates that should be added If the blueprint does not haveĪ ``url_prefix``, the app's static route will take precedence,Īnd the blueprint's static files won't be accessible. :param static_url_path: The url to serve static files from.ĭefaults to ``static_folder``. :param static_folder: A folder with static files that should be This helps locate the ``root_path`` for the :param import_name: The name of the blueprint package, usually See :doc:`/blueprints` for more information. When the blueprint is registered on an application. Same decorators as :class:`~flask.Flask`, but defers the need for anĪpplication by recording them for later registration.ĭecorating a function with a blueprint creates a deferred function Without requiring an application object ahead of time. Module « flask.blueprints » Classe « Blueprint » Informations générales Héritage builtins.objectīlueprint Définition class Blueprint(Scaffold): Description Represents a blueprint, a collection of routes and otherĪpp-related functions that can be registered on a real applicationĪ blueprint is an object that allows defining application functions ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |