That exception looks like Flask-Uploads
is trying to from werkzeug import secure_filename
which should be from werkzeug.utils import secure_filename
, as per your own code.
Going by the Flask-Uploads
github repo this appears to have been fixed 12 months ago.
I'd try pip install -U flask-uploads
in your virtual environment, to ensure the latest version.
EDIT:
As @mattficke points out, the PyPi version is dated, and there's not a more recent release on the repo. Turns out you can install directly based on a commit hash, so for the latest (at the time of writing this):
pip install git+https://github.com/maxcountryman/flask-uploads.git@f66d7dc
Or in a requirements.txt
:
git+https://github.com/maxcountryman/flask-uploads.git@f66d7dc
Then pip install -r requirements.txt
.
Which works wonders:
>>> from flask_uploads import UploadSet,configure_uploads,IMAGES,DATA,ALL
>>> # No Exception
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…