我正在制作一个Django应用程序API,其中授权用户可以发布消息,其他用户可以浏览消息和喜欢/不喜欢/评论消息(twitter风格)。 我已经实现了oAuth2并对其进行了测试。API在管理面板中运行良好,但是当我通过url访问它时,它给出了错误: enter image description here 我的models.py类是: class Posts(models.Modelimport adminfrom
我对django很陌生。我正在尝试创建一个简单的rest端点,但是我得到了一个404。我肯定我错过了一些场景。model = DisplayItemsurls.pyfrom django.contrib'^zzz/', DisplayItemsViews.as_view()),views.py
from rest_framework.response import Re
但是,当尝试获取令牌时,我遇到了问题,并且总是返回错误'str' object has no attribute 'decode'。] 'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthenticationimport <e