我最近安装了 Blogango,出现以下错误:
CommandError: One or more models did not validate:
blogango.blogentry: 'created_by' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
所以我添加了 settings.AUTH_USER_MODEL ,现在我收到以下消息:
ValueError: Cannot create form field for 'created_by' yet, because its related model 'users.User' has not been loaded yet
我浏览了它调用的 settings.py AUTH_USER_MODEL = 'users.User'
,并将其移到了 settings.py 的更高位置,以尝试更快地加载它。
按照要求:
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, unique=False)
我能做些什么来解决这个问题?