Method: flask.app.Flask.register_blueprint
Calls: 80, Exceptions: 2, Paths: 1Back
Path 1: 80 calls (1.0)
Blueprint (79) test_default_static_max_age.
{} (36) {'url_prefix': '/py'} (19) {'url_prefix': '/bp'} (10) {'url_prefix': '/parent'} (3) dict (2) {'url_prefix': None} (2) {'url_prefix': '/bp_pref...
ValueError (2)
1@setupmethod
2 def register_blueprint(self, blueprint: Blueprint, **options: t.Any) -> None:
3 """Register a :class:`~flask.Blueprint` on the application. Keyword
4 arguments passed to this method will override the defaults set on the
5 blueprint.
6
7 Calls the blueprint's :meth:`~flask.Blueprint.register` method after
8 recording the blueprint in the application's :attr:`blueprints`.
9
10 :param blueprint: The blueprint to register.
11 :param url_prefix: Blueprint routes will be prefixed with this.
12 :param subdomain: Blueprint routes will match on this subdomain.
13 :param url_defaults: Blueprint routes will use these default values for
14 view arguments.
15 :param options: Additional keyword arguments are passed to
16 :class:`~flask.blueprints.BlueprintSetupState`. They can be
17 accessed in :meth:`~flask.Blueprint.record` callbacks.
18
19 .. versionchanged:: 2.0.1
20 The ``name`` option can be used to change the (pre-dotted)
21 name the blueprint is registered with. This allows the same
22 blueprint to be registered multiple times with unique names
23 for ``url_for``.
24
25 .. versionadded:: 0.7
26 """
27 blueprint.register(self, options)