Answer the question
In order to leave comments, you need to log in
How to remove automatic search by static in FLASK?
It is necessary, using flask python, on the local server (website) to upload pictures from a folder outside the static folder. Those. how can I replace the automatic search for images in the static folder, for example, with absolutely any path on the user's computer?
Answer the question
In order to leave comments, you need to log in
You can solve this problem in different ways, for example:
Make a symbolic link to the folder.
And you can do it through CUSTOM_STATIC_PATH, which you describe in the config and write
return send_from_directory(app.config['CUSTOM_STATIC_PATH'], filename=filename, mimetype='image/jpeg')
In general, if you describe the problem more precisely, you can more accurately describe its solution))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question