Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed a terrible wrong part in the module documentation

  • Loading branch information...
1 parent 6562f2e commit 8ed051d5b5f136397e26dc20845869366afc2cae @mitsuhiko mitsuhiko committed
Showing with 10 additions and 7 deletions.
  1. +10 −7 docs/patterns/packages.rst
17 docs/patterns/packages.rst
@@ -248,22 +248,25 @@ If you want to refer to the templates you just have to prefix it with the
name of the module. So for the admin it would be
``render_template('admin/list_items.html')`` and so on. It is not
possible to refer to templates without the prefixed module name. This is
-explicit unlike URL rules.
+explicit unlike URL rules. Also with the move of the views into from
+`yourapplication.views.admin` too `yourapplication.apps.admin.views` you
+will have to give the module an explit shortname. Why? Because otherwise
+all your modules will be internally known as `views` which is obviously
+not what you want::
-You also need to explicitly pass the ``url_prefix`` argument when
-registering your modules this way::
+ # in yourapplication/apps/admin/
+ admin = Module(__name__, 'admin')
+The setup code changes slightly because of the imports::
# in yourapplication/
from flask import Flask
from yourapplication.apps.admin.views import admin
from yourapplication.apps.frontend.views import frontend
app = Flask(__name__)
app.register_module(admin, url_prefix='/admin')
- app.register_module(frontend, url_prefix='/frontend')
-This is because Flask cannot infer the prefix from the package names.
+ app.register_module(frontend)
.. admonition:: References to Static Folders

0 comments on commit 8ed051d

Please sign in to comment.
Something went wrong with that request. Please try again.