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

cannot import name 'JWTSerializer' from 'dj_rest_auth.app_settings' #486

Closed
OttoAndrey opened this issue Feb 18, 2023 · 2 comments
Closed

Comments

@OttoAndrey
Copy link

Hi! I am migrating project from django-rest-auth to dj-rest-auth. And got this error ImportError: cannot import name 'JWTSerializer' from 'dj_rest_auth.app_settings' when trying open page with open-api generated by drf-spectacular

Problem here in rest_auth.py file

def get_token_serializer_class():
    from dj_rest_auth.app_settings import JWTSerializer, TokenSerializer  # raise erorr here :(

    if getattr(settings, 'REST_USE_JWT', False):
        return JWTSerializer
    else:
        return TokenSerializer

My setup
django==4.1.7
dj-rest-auth==3.0.0

Can you help me?

@mostaszewski
Copy link

It is a bug due to the latest dj-rest-auth update (3.0.0).
You can find more information here: tfranzel/drf-spectacular#937

@OttoAndrey
Copy link
Author

I got it. Thank you!

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