Djaong 查询数据库 DoesNotExist 异常 异常应该为 models类名.DoesNotExist try: user = UserProfile.objects.get(username=username) except:UserProfile.DoesNotExist: pass