I've had similar use cases where I needed access to the request in a number
of places. I've come to the conclusion that any code that is expected to
operate under wsgi (and only under wsgi, and not via management commands)
to use thread locals.
see https://github.com/nebstrebor/django-threadlocals
Probably a good way to solve this problem is to add `request` (with default
`None`) argument to `Model.save` method, which could then be passed to the
storage used for file fields.
Let us discuss if this is a good solution or can we invent something better.
On Sunday, January 29, 2017 at 8:12:1
See also
https://code.djangoproject.com/ticket/27786
I attempt to make file storage behavior dependent on the current user.
(In fact, I attempted to store the ID of the uploader of a given file
into the database, so that other users could not list or delete this
file. Also I tried to store the fi