Django 运行时发生异常ValueError: save() prohibited to prevent data loss due to unsaved related object ‘user

异常:

Django 运行时发生异常ValueError: save() prohibited to prevent data loss due to unsaved related object ‘user_第1张图片

原因:

  save()由于未保存的相关对象导致数据丢失

解决:

必须要使用save()保存数据

Django 运行时发生异常ValueError: save() prohibited to prevent data loss due to unsaved related object ‘user_第2张图片

 

 

你可能感兴趣的:(Django,python)