[Fixed]-Unabe to get token from DRF get-token api

1👍

You should remove write_only=True from your serializer. that would fix the error.

0👍

The Error message actually tells you that your request is not able to reach the view, this happens because one of the middlewares raises an error.

The easiest (but pbly not very secure) solution would be to return the API token on successful signup, or to add another View with a login (which returns an token).

For a definite answer you would need to provide more information like the configuration for your Authentication Backends.

You can find here more Informations about Authentication in DRF
http://www.django-rest-framework.org/api-guide/authentication/#how-authentication-is-determined

Leave a comment