More upgrade notes for blueprints
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 207a790 · Browse files · 1 file·+37 added−0 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+37 added−0 removed
- other:+37 added−0 removed
Provenance
- Commit
c9cd608- Tree
c7d9cc9- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
207a790
1 file changed+37 added−0 removed
modified:docs/upgrading.rst+37 added
158 unmodified lines159 ...160 161 (Note that :meth:`register_error_handler` is new in Flask 0.7)162 163+Blueprint Support164+`````````````````165 166+Blueprints replace the previous concept of “Modules” in Flask. They167+provide better semantics for various features and work better with large168+applications. The update script provided should be able to upgrade your169+applications automatically, but there might be some cases where it fails170+to upgrade. What changed?171+172+- Blueprints need explicit names. Modules had an automatic name173+ guesssing scheme where the shortname for the module was taken from the174+ last part of the import module. The upgrade script tries to guess175+ that name but it might fail as this information could change at176+ runtime.177+- Blueprints have an inverse behavior for :meth:`url_for`. Previously178+ ``.foo`` told :meth:`url_for` that it should look for the endpoint179+ `foo` on the application. Now it means “relative to current module”.180+ The script will inverse all calls to :meth:`url_for` automatically for181+ you. It will do this in a very eager way so you might end up with182+ some unnecessary leading dots in your code if you're not using183+ modules.184+- Blueprints do not automatically provide static folders. They will185+ still export templates from a folder called `templates` next to their186+ location however. If you want to continue serving static files you187+ need to tell the constructor explicitly the path to the static folder188+ (which can be relative to the blueprint's module path).189+- Rendering templates was simplified. Now the general syntax is190+ ``blueprint-shortname:template-name`` for rendering templates instead191+ of ``blueprint-shortname/template-name`` which was confusing and often192+ clashed with templates from the global template loader.193+194+If you continue to use the `Module` object which is deprecated, Flask will195+restore the previous behavior as good as possible. However we strongly196+recommend upgrading to the new blueprints as they provide a lot of useful197+improvement such as the ability to attach a blueprint multiple times,198+blueprint specific error handlers and a lot more.199+200+201 Version 0.6202 -----------203 204 Flask 0.6 comes with a backwards incompatible change which affects the87 unmodified lines