Skip to content
Myr

Update docs - add command for listing rules.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kamil Wargula · committed by Kamil Wargula · parent 7627d9c · Browse files · 1 file+6 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−4 removed

  • other:+6 added−4 removed

1 file+6 added−4 removed

modified:docs/blueprints.rst+6 added-4 removed
93 unmodified lines
9495If you check the rules registered on the application, you will find96these::9798 >>> app.url_map98 [<Rule '/static/<filename>' (HEAD, OPTIONS, GET) -> static>,99 Map([<Rule '/static/<filename>' (HEAD, OPTIONS, GET) -> static>,100 <Rule '/<page>' (HEAD, OPTIONS, GET) -> simple_page.show>,100 <Rule '/' (HEAD, OPTIONS, GET) -> simple_page.show>]101 <Rule '/' (HEAD, OPTIONS, GET) -> simple_page.show>])102103The first one is obviously from the application itself for the static104files. The other two are for the `show` function of the ``simple_page``105blueprint. As you can see, they are also prefixed with the name of the
4 unmodified lines
110 app.register_blueprint(simple_page, url_prefix='/pages')111112And sure enough, these are the generated rules::113114 >>> app.url_map113 [<Rule '/static/<filename>' (HEAD, OPTIONS, GET) -> static>,115 Map([<Rule '/static/<filename>' (HEAD, OPTIONS, GET) -> static>,116 <Rule '/pages/<page>' (HEAD, OPTIONS, GET) -> simple_page.show>,115 <Rule '/pages/' (HEAD, OPTIONS, GET) -> simple_page.show>]117 <Rule '/pages/' (HEAD, OPTIONS, GET) -> simple_page.show>])118119On top of that you can register blueprints multiple times though not every120blueprint might respond properly to that. In fact it depends on how the121blueprint is implemented if it can be mounted more than once.
155 unmodified lines