我正在为一个假想的社交网络编写一个聊天应用程序,但是当我试图打开聊天页面时,我给出了以下错误:'AnonymousUser‘object has no attribute 'profile’错误。我认为模型文件中可能有问题,但我不能真正弄清楚如何修复它,我现在真的很困惑!?谁能给点建议??request): print request.POST
request.user.profile.is_chat_user=True
我为我的django应用程序创建了一个用户模型 """ Business models refer back to this model. email = EmailField(unique=Trueuser_type = CharField(max_length=10, choices=USER_TYPES)
creat
from django.urls import reversefrom rest_framework.authtoken.modelsdef test_print_name(self): # do something here
为什么我尝试使用简单的User.objects.create创建一个用户,它还将与is_authenticated一样返