Use extension import transition
http://flask.pocoo.org/docs/extensiondev/#extension-import-transition