【发布时间】:2021-05-21 12:25:55
【问题描述】:
我通过邮递员检查了api操作。
我不知道是什么问题..
我认为代码没有问题
这是我的代码 项目文件夹 urls.py
url(r'^', include('django.contrib.auth.urls')),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
url(r'^account/', include('allauth.urls')),
url(r'^accounts-rest/registration/account-confirm-email/(?P<key>.+)/$',
confirm_email, name='account_confirm_email'),
settings.py
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
# 'rest_framework.permissions.IsAuthenticated',
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
),
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
],
'DEFAULT_RENDERER_CLASSES': [
'rest_framework.renderers.JSONRenderer',
],
}
REST_AUTH_SERIALIZERS = {
'USER_DETAILS_SERIALIZER': 'accounts.serializers.UserSerializer',
}
任何提示将非常非常非常感谢:)
【问题讨论】:
标签: django-rest-framework django-rest-auth django-rest-framework-jwt