django-queued-storage icon indicating copy to clipboard operation
django-queued-storage copied to clipboard

makemigrations error

Open aztrock opened this issue 6 years ago • 2 comments

$ python manager makemigrations

...
  File "/opt/project/lib/python3.5/site-packages/django/db/migrations/serializer.py", line 332, in serializer_factory
    "topics/migrations/#migration-serializing" % (value, get_docs_version())
ValueError: Cannot serialize: <queued_storage.backends.QueuedStorage object at 0x7f06cf150e10>
There are some values Django cannot serialize into migration files.
For more, see https://docs.djangoproject.com/en/2.2/topics/migrations/#migration-serializing

$python --version Python 3.7.2

aztrock avatar May 22 '19 20:05 aztrock

i am getting the same error

Gilbishkosma avatar Dec 05 '20 18:12 Gilbishkosma

After some search i found out that applying a @deconstructible decorator on the QueuedStorage class fix this issue. more about Deconstructible

This is how i applied the decorator:

   from queued_storage.backends import QueuedStorage
   from django.utils.deconstruct import deconstructible

   QueuedStorage = deconstructible(QueuedStorage)
   
   queued_s3storage = QueuedStorage(
          'django.core.files.storage.FileSystemStorage',
          'storages.backends.s3boto.S3BotoStorage')

Gilbishkosma avatar Dec 05 '20 18:12 Gilbishkosma