Django saves the data but eventually raises an IntegrityError. Django中保存的数据,但最终引发一个IntegrityError。 If there is an error, why it is saving that data?如果有一个错误,为什么它被保存的数据? And I'm sure that the uniqueness property is not violated on that data.而且我敢肯定,没有违反该数据的唯一性。
What is going on?这是怎么回事呢? Why is that error occurs?这是为什么发生错误?and how can I solve that?我怎样才能解决这个问题呢?
Most likely your model has a field which doesn't allow null value and you are trying to add object without any value for that field.最有可能你的模型中有一个字段不允许空值,您尝试添加该字段的值没有任何对象。
If you can Edit your post and add more details (like model & traceback) then you can expect better response.如果您可以编辑您的文章和添加更多的细节(如模型及追踪),那么你可以期待更好的响应。