Django Model Field Reference BinaryField

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

This is a specialized field, used to store binary data. It only accepts bytes. Data is base64 serialized upon storage.

As this is storing binary data, this field cannot be used in a filter.

from django.db import models

class MyModel(models.Model):
    my_binary_data = models.BinaryField()


Got any Django Question?