0
當我做manage.py syncdb
我得到:執行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)
UUIDField從哪裏來?它可能默認爲'null = True'?如果是這樣,你可以通過專門設置'null = False'來覆蓋它嗎? –