djangorestframework-simplejwt
djangorestframework-simplejwt copied to clipboard
I have set AllowAny for the registration view in Django, but it still triggers a User.DoesNotExist error. How can I handle this error and ensure successful registration?
I have set AllowAny for the registration view in Django, but it still triggers a User.DoesNotExist error. How can I handle this error and ensure successful registration?
# settings.py
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': 'main.exceptions.exception_handler',
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.BasicAuthentication',
'rest_framework_simplejwt.authentication.JWTAuthentication',
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.SessionAuthentication',
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
'DEFAULT_SCHEMA_RENDERER': 'rest_framework.schemas.coreapi.AutoSchema',
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema',
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'DEFAULT_FILTER_BACKENDS': [
'django_filters.rest_framework.DjangoFilterBackend'
],
'PAGE_SIZE': 10
}
@Friedrich-hue can you share your registration view !!!