K
K
kuzdman2019-03-05 13:28:41
Python
kuzdman, 2019-03-05 13:28:41

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

1 answer(s)
N
Nicke_grodno, 2019-03-13
@Nicke_grodno

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 question

Ask a Question

731 491 924 answers to any question