Merge pull request #3069 from shidenggui/feature_allow_customizing_url_map
Allow customizing url map class
This commit is contained in:
commit
05102f63b8
2 changed files with 9 additions and 1 deletions
|
|
@ -40,6 +40,8 @@ Unreleased
|
||||||
:issue:`3134`
|
:issue:`3134`
|
||||||
- :meth:`jsonify` supports :class:`dataclasses.dataclass` objects.
|
- :meth:`jsonify` supports :class:`dataclasses.dataclass` objects.
|
||||||
:pr:`3195`
|
:pr:`3195`
|
||||||
|
- Allow customizing the :attr:`Flask.url_map_class` used for routing.
|
||||||
|
:pr:`3069`
|
||||||
|
|
||||||
.. _#2935: https://github.com/pallets/flask/issues/2935
|
.. _#2935: https://github.com/pallets/flask/issues/2935
|
||||||
.. _#2957: https://github.com/pallets/flask/issues/2957
|
.. _#2957: https://github.com/pallets/flask/issues/2957
|
||||||
|
|
|
||||||
|
|
@ -350,6 +350,12 @@ class Flask(_PackageBoundObject):
|
||||||
#: .. versionadded:: 0.7
|
#: .. versionadded:: 0.7
|
||||||
url_rule_class = Rule
|
url_rule_class = Rule
|
||||||
|
|
||||||
|
#: The map object to use for storing the URL rules and routing
|
||||||
|
#: configuration parameters. Defaults to :class:`werkzeug.routing.Map`.
|
||||||
|
#:
|
||||||
|
#: .. versionadded:: 1.1.0
|
||||||
|
url_map_class = Map
|
||||||
|
|
||||||
#: the test client that is used with when `test_client` is used.
|
#: the test client that is used with when `test_client` is used.
|
||||||
#:
|
#:
|
||||||
#: .. versionadded:: 0.7
|
#: .. versionadded:: 0.7
|
||||||
|
|
@ -567,7 +573,7 @@ class Flask(_PackageBoundObject):
|
||||||
#:
|
#:
|
||||||
#: app = Flask(__name__)
|
#: app = Flask(__name__)
|
||||||
#: app.url_map.converters['list'] = ListConverter
|
#: app.url_map.converters['list'] = ListConverter
|
||||||
self.url_map = Map()
|
self.url_map = self.url_map_class()
|
||||||
|
|
||||||
self.url_map.host_matching = host_matching
|
self.url_map.host_matching = host_matching
|
||||||
self.subdomain_matching = subdomain_matching
|
self.subdomain_matching = subdomain_matching
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue