Small change to the packages documentation example for clarity

This commit is contained in:
agentultra 2010-10-06 21:55:42 +08:00 committed by Armin Ronacher
parent 085faf2a77
commit 325b96099a

View file

@ -162,9 +162,14 @@ modules in the application (`__init__.py`) like this::
from yourapplication.views.frontend import frontend from yourapplication.views.frontend import frontend
app = Flask(__name__) app = Flask(__name__)
app.register_module(admin) app.register_module(admin, url_prefix='/admin')
app.register_module(frontend) app.register_module(frontend)
We register the modules with the app so that it can add them to the
URL map for our application. Note the prefix argument to the admin
module: by default when we register a module, that module's end-points
will be registered on `/` unless we specify this argument.
So what is different when working with modules? It mainly affects URL So what is different when working with modules? It mainly affects URL
generation. Remember the :func:`~flask.url_for` function? When not generation. Remember the :func:`~flask.url_for` function? When not
working with modules it accepts the name of the function as first working with modules it accepts the name of the function as first