This works for quite a few simple and not so simple usecases. You should look into using proper oauth2 or oidc when it makes sense to do so.
For example if you want multiple services or sites to use the same login/token. There is keycloak and django-oidc-provider. Those handle users and tokens for you.
For example if you want multiple services or sites to use the same login/token. There is keycloak and django-oidc-provider. Those handle users and tokens for you.