I am trying to implement an API which returns a token upon a post request with valid email and password. I am using the rest framework for token authentication. To do this, I customized the ObtainAuthToken view from rest_framework to use my own serializer which works with an email instead of a username. The endpoint works flawlessly but I don't get the browsable API when I visit the endpoint in my browser. I just get a blank page with the following line:
{"detail":"Method \"GET\" not allowed."}
views.py
from rest_framework.authtoken.views import ObtainAuthToken
from .serializers import UserTokenSerializer
class CreateUserToken(ObtainAuthToken):
serializer_class = UserTokenSerializer
What is wrong with my view? I think I'm missing something.
I had to set renderer_classes like so: