分类: Python/Ruby
2013-04-11 16:31:33
For a while we recommended using namespace packages for Flask extensions. This turned out to be problematic in practice because many different competing namespace package systems exist and pip would automatically switch between different systems and this caused a lot of problems for users.
Instead we now recommend naming packages flask_foo instead of the now deprecatedflaskext.foo. Flask 0.8 introduces a redirect import system that lets uses import fromflask.ext.foo and it will try flask_foo first and if that fails flaskext.foo.
Flask extensions should urge users to import from flask.ext.foo instead of flask_foo orflaskext_foo so that extensions can transition to the new package name without affecting users.