tecladocode / advanced-rest-api-lecture-codes

Start and end codes for the lectures of our Advanced REST APIs with Flask and Python course
30 stars 73 forks source link

Flask-Uploads not working #7

Open LUS24 opened 2 years ago

LUS24 commented 2 years ago

It seems Flask-Uploads got outdated. Here is a fix for the error ImportError: cannot import name 'secure_filename' from 'werkzeug':

https://stackoverflow.com/questions/61628503/flask-uploads-importerror-cannot-import-name-secure-filename

In flask_uploads.py

Change

from werkzeug import secure_filename, FileStorage

to

from werkzeug.utils import secure_filename
from werkzeug.datastructures import  FileStorage
sidd6p commented 1 year ago

Would you like to assign this issue to me

jslvtr commented 1 year ago

@sidd6p If you want to try your hand at this, that would be really appreciated! A few things to take into consideration:

Let us know if you want to go for it!