0๐
โ
It appears that DRFโs ImageField returns full URL if request
has been provided to serializer context, so there is no need for explicit URL construction. Clean and elegant (requires source studying though โ official documentation does not mention this)
๐คMike Doudkin
1๐
I kinda solved it like this:
changed
if instance.image:
to
if instance.image and self.request:
so these under-the-hood get_image()
calls without a proper self.request
do not cause crashes anymore.
Still, it would be great to know why all of the above takes place
๐คMike Doudkin
Source:stackexchange.com