0

当我这样做时,manage.py syncdb我得到:

Error: One or more models did not validate:
users.userprofile: "uuid": Primary key fields cannot have null=True.

即使我class UserProfile(models.Model)有:

uuid = UUIDField(primary_key=True, auto=True, editable=False)
4

1 回答 1

0

丹尼尔的评论可能就是这样,我只是不知道如何遵循线索。

来自Joshua的解决方法是删除官方的并用 Joshua 的叉子django-uuidfield替换它们。

-django-uuidfield==0.4
-django-uuidfield-2==0.6.5
+# django-uuidfield==0.4
+# django-uuidfield-2==0.6.5
+-e git://github.com/joshuakarjala/django-uuidfield.git#egg=django-uuidfield

记得要pip uninstall django-uuidfieldpip uninstall django-uuidfield-2之前pip install -r requirements.txt

于 2012-12-13T12:33:37.547 回答