kasulani / drf_tutorial

This is a simple API for a music service that i developed for my tutorial on DRF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError at /api/v1/auth/register/

Gaerdy opened this issue · comments

Hi Kasulani,

First of all thanks for your tutorial, it realy helps me understanding some facets of DRF !

I followed all the steps you describe on the readme file to run your application but I can't register.
I get the following error :

AssertionError at /api/v1/auth/register/

'RegisterUsers' should either include a serializer_class attribute, or override the get_serializer_class() method.

Request Method: | GET
Request URL: | http://localhost:8000/api/v1/auth/register/
Django Version: | 2.0.3

Hi Gaerdy,

You have to include serializer_class for the TokenSerializer in the LoginView, put the below snippet on the first line of LoginView
serializer_class = TokenSerializer