I’m writing a simple class for DRF field for handling base64 string for attachment both image and file. I’m using DRF 3 at this case.
And here is how to use it following below.
class MyModelSerializer(serializers.ModelSerializer): company_logo = Base64CharField(required=False) class Meta: model = MyModel fields = '__all__'
Feel free to use and improve my code. 😀