This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
Hi, the documentation says "Optional either username or email can be used, or both. It returns response with token along with it for authentication" but it doesn't work if I don't provide an email address.
In api/serializers.py:
class UserLoginSerializer(serializers.Serializer):
email = serializers.EmailField(required=False)
username = serializers.CharField(required=False)
password = serializers.CharField()
def validate(self, data):
email = data['email']
if not 'email' in data and not 'username' in data :
raise serializers.ValidationError('Enter Username Or Email')
return data
I suggest deleting the line email = data['email'] because the email variable is not used in this function and causes an error if there is no email given.
Hi, the documentation says "Optional either username or email can be used, or both. It returns response with token along with it for authentication" but it doesn't work if I don't provide an email address.
In
api/serializers.py
:I suggest deleting the line
email = data['email']
because theemail
variable is not used in this function and causes an error if there is no email given.