Exception Type: RelatedObjectDoesNotExist
解决方案由两个:
1.在后台通过 profiles–》Add profile 为用户自行添加一个profile,这样在前台/account/edit就能显示出来了
2.在views.py的edit方法中添加异常处理(如下图)
需要导入from django.core.exceptions import ObjectDoesNotExist
referene:https://blog.csdn.net/weixin_30408165/article/details/96696547