当我这样做时,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)
当我这样做时,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)
丹尼尔的评论可能就是这样,我只是不知道如何遵循线索。
来自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-uuidfield
和pip uninstall django-uuidfield-2
之前pip install -r requirements.txt
。