Skip to content
Myr

Small change to the packages documentation example for clarity

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

authored by agentultra · committed by Armin Ronacher · parent 085faf2 · Browse files · 1 file+6 added−1 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−1 removed

  • other:+6 added−1 removed

1 file+6 added−1 removed

modified:docs/patterns/packages.rst+6 added-1 removed
160 unmodified lines
161 from yourapplication.views.admin import admin162 from yourapplication.views.frontend import frontend163164 app = Flask(__name__)165 app.register_module(admin)165 app.register_module(admin, url_prefix='/admin')166 app.register_module(frontend)167168We register the modules with the app so that it can add them to the169URL map for our application. Note the prefix argument to the admin170module: by default when we register a module, that module's end-points171will be registered on `/` unless we specify this argument.172173So what is different when working with modules? It mainly affects URL174generation. Remember the :func:`~flask.url_for` function? When not175working with modules it accepts the name of the function as first176argument. This first argument is called the "endpoint". When you are
110 unmodified lines