This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a User registration serializer | |
# When the user sends the request with his data — in this case, email and password —, | |
# we create a new user with is_verified=False (builtin field in default user model) | |
# Then we send an email containing a verification link | |
# You can customize it so you link points to a route in your fronted, if you use Django only for the backend | |
# After that you can create a view that uses this serializer | |
from django.urls import reverse | |
from rest_framework import serializers | |
from django.core.mail import send_mail | |
from django.conf import settings |