Learn more. How to download images or files from Custom Storage In Django? Ask Question. Asked 7 months ago. Active 7 months ago. Viewed times. Is there any possible way that you can download images from object storage. Here is my code. My settings. Please try again. Improve this question. Yatish Soorma. Yatish Soorma Yatish Soorma 1 1 1 bronze badge.
Add a comment. I ended up subclassing FileField:. As you can see, all I did was remove the local file system related logic. Unfortunately, my custom file fields need to inherit from this class to work with Azure storage, and when I switch to local storage in a different environment, they have to inherit from the regular FileField!
This is obviously an undesirable situation, imposed by the tight coupling to local file system logic in the three methods of FileField. In order to truly decouple this, FileField would need to be a little bit more agnostic about the storage backend. I classified this as a bug, as this case shows that you're not entirely able to do anything you want when implementing custom storage backends.
The main question is whether or not the changes can be made in a backwards compatible fashion. Not sure if my edit generated a notification, so, bump.
Please see comment In c72b :. Fixed -- Delegated os. Project details Project links Homepage GitHub. Download files Download the file for your platform. Files for custom-django-auth-backend, version 0. Close Hashes for custom-django-auth-backend File type Wheel. Python version py3. Upload date Apr 23, Hashes View. File type Source.
0コメント