mcastle mcastle - 10 days ago 5x
Python Question

Upgrading to Django 1.7. Getting error: Cannot serialize: <storages.backends.s3boto.S3BotoStorage object

I am trying to upgrade a django app from django 1.6.6 to 1.7 and am using python 2.7.8. When I run

python makemigrations
, I get the following error:

ValueError: Cannot serialize: <storages.backends.s3boto.S3BotoStorage object at 0x11116eed0>
There are some values Django cannot serialize into migration files.

And here is the relevant code:

protected_storage = storages.backends.s3boto.S3BotoStorage(

class Document(models.Model):
file = models.FileField(upload_to='media/docs/', max_length=10000, storage=protected_storage)

def __unicode__(self):
return "%s" % self.candidate

def get_absolute_url(self):
return reverse('documents', args=[str(])

I've read the migration docs and read about a similar issue here, but I've been unable to resolve this. My app uses django-storages and boto to save files onto Amazon S3. Any help is appreciated.


Just make a deconstructible subclass and use it instead.

from django.utils.deconstruct import deconstructible

class MyS3BotoStorage(S3BotoStorage):