TypeError: metaclass conflict: the metaclass of a derived. Django 1.8, python 2.7

TypeError: metaclass conflict: the metaclass of a derived. Django 1.8, python 2.7

我在使用 Python 2.7 和 Django 1.8 时收到有关元 class 的以下异常:

TypeError: metaclass conflict: the metaclass of a derived

异常并不总是出现,我发现很难跟踪问题实际发生的位置,因为它后来神秘地消失了。

问题出在django-framework中的resource.py函数filter_response():

return self.serialize(obj)

谁能告诉我为什么会出现这个错误?

几周后,该问题再次发生。 我发现是因为多进程中的应用程序 运行 和其中一个错误进程破坏了 _meta class.