noirbizarre / flask-fs

Simple and easy file storages for Flask
https://flask-fs.readthedocs.org
MIT License
31 stars 15 forks source link

get_metadata() fails with flask context outside of flask server #33

Open AbdealiLoKo opened 5 years ago

AbdealiLoKo commented 5 years ago

I am trying to run my celery workers which connects to my FileSystem to save files. When doing so, I am using the same filesystem management that my Flask applicaiton is using so that it is consistent for my async jobs (with celery) as well as my sync jobs (with wsgi flask).

When I do this, I get the following in get_metadata() when trying to find the "url". I have no need for using URL here, but because the get_metadata() seems to always try to populate the URL it causes issues.

TaskException: RuntimeError: Application was not able to create a URL adapter for request independent URL generation. You might be able to fix this by setting the SERVER_NAME config variable.