Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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? #734

Open
Friedrich-hue opened this issue Aug 8, 2023 · 2 comments

Comments

@Friedrich-hue
Copy link

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?

@Friedrich-hue
Copy link
Author

# 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
}

@bonface221
Copy link

@Friedrich-hue can you share your registration view !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants