擅长:python、mysql、java
<p>这里的基本问题是,您正在尝试使用django1.7和一个包(<code>django-storages</code>)一起使用,该包似乎还没有更新到可以使用该版本。在</p>
<p>以下是<a href="https://docs.djangoproject.com/en/dev/topics/migrations/#serializing-values">documentation</a>的一些摘录,以解释正在发生的事情:</p>
<blockquote>
<p>Migrations are just Python files containing the old definitions of your models - thus, to write them, Django must take the current state of your models and serialize them out into a file.</p>
<p>While Django can serialize most things, there are some things that we just can’t serialize out into a valid Python representation - there’s no Python standard for how a value can be turned back into code.</p>
<p>You can let Django serialize your own custom class instances by giving the class a deconstruct() method.</p>
</blockquote>
<p>所以这里的解决方案是给类<code>storages.backends.s3boto.S3BotoStorage</code>一个<code>deconstruct()</code>方法。这可能与应用<a href="https://docs.djangoproject.com/en/dev/topics/migrations/#adding-a-deconstruct-method">^{<cd4>}</a>类修饰符一样简单。在</p>
<p>大概包在某个时候会包含这个变更(或者可能主分支已经有了它?),但你也可以自己修补。在</p>