general03 / flask-autoindex

Generates index page like mod_autoindex
https://flask-autoindex.readthedocs.io
MIT License
114 stars 34 forks source link

Switch to direct import names for compatibility with newer versions of Flask #30

Closed radusuciu closed 8 years ago

radusuciu commented 8 years ago

The error message thrown by Flask:

ExtDeprecationWarning: Importing flask.ext.silk is deprecated, use flask_silk instead.

Additionally, the docs suggest that one consume Flask-AutoIndex with the flask.ext.autoindex import hook as opposed to the direct import name flask_autoindex.

From the Flask docs:

Extension Import Transition

In early versions of Flask we recommended using namespace packages for Flask extensions, of the form flaskext.foo. This turned out to be problematic in practice because it meant that multiple flaskext packages coexist. Consequently we have recommended to name extensions flask_foo over flaskext.foo for a long time.

Flask 0.8 introduced a redirect import system as a compatibility aid for app developers: Importing flask.ext.foo would try flask_foo and flaskext.foo in that order.

As of Flask 0.11, most Flask extensions have transitioned to the new naming schema. The flask.ext.foo compatibility alias is still in Flask 0.11 but is now deprecated – you should use flask_foo.