我想用AzureStorage來連接azure存儲和django 1.7應用程序。ValueError:無法序列化:<myproject.storage.AzureStorage對象在0x7f85185e66d0>
models.py
from django.db import models
from myproject.storage import AzureStorage
class MyModel(models.Model):
my_file = models.FileField(upload_to="files", storage=AzureStorage(container="media"))
my_image = models.ImageField(upload_to="images", storage=AzureStorage(container="media"))
但是當我嘗試makemigrations我越來越:
ValueError: Cannot serialize: <myproject.storage.AzureStorage object at 0x7f85185e66d0>
There are some values Django cannot serialize into migration files.
For more, see https://docs.djangoproject.com/en/dev/topics/migrations/#migration-serializing
究竟它不能夠序列化?
maybe modified_time ...試着調試它...它只有64行代碼,沒有人更新2年:D – madzohan
將@deconstructible添加到AzureStorage類修復此錯誤 –