我最近安装了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.
Run Code Online (Sandbox Code Playgroud)
所以我添加了settings.AUTH_USER_MODEL,现在我收到以下消息:
ValueError: Cannot create form field for 'created_by' yet, because its related model 'users.User' has not been loaded yet
Run Code Online (Sandbox Code Playgroud)
我通过我调用的settings.py AUTH_USER_MODEL = 'users.User',然后将它向上移动到settings.py上以尝试更快地加载它.
按照要求:
created_by = models.ForeignKey(settings.AUTH_USER_MODEL, unique=False)
我该怎么做才能解决这个问题?
django ×1