1👍
Create TextField in Model encode the file to base64 & Store in it.
import base64
from django.db import models
class Blob(models.Model):
file = models.TextField(
db_column='data',
blank=True)
def set_data(self, data):
self.file = base64.encodestring(data)
def get_data(self):
return base64.decodestring(self.file)
data = property(get_data, set_data)
Source:stackexchange.com