kyuu
kyuu

Reputation: 21

Django validate email in Registration Form

Is there a way to validate email format in registration of account in Django?

I would like to allow users to only use gsfe accounts as their email when they are going to register in the app.

Upvotes: 1

Views: 298

Answers (1)

Robo
Robo

Reputation: 733

You can use a UserSerializer to check data, something like:

class UserSerializer(serializers.Serializer):
    email = serializers.EmailField()
    username = serializers.CharField(max_length=100)

You can also use Django Forms to create your registration form.

Upvotes: 2

Related Questions