try this # Custom Djoser serializer
from djoser.serializers import UserCreateSerializer

class CustomUserCreateSerializer(UserCreateSerializer):
    def perform_create(self, serializer):
        user = serializer.save()
        # Generate verification code and send email
        verification_code = generate_verification_code()
        send_verification_email(user.email, verification_code)
        # Store verification code in user profile or custom model
        user.profile.verification_code = verification_code
        user.profile.save()

# Custom Djoser view
from djoser.views import UserCreateView

class CustomUserCreateView(UserCreateView):
    serializer_class = CustomUserCreateSerializer

# URLs
from django.urls import path

urlpatterns = [
    path('auth/users/create/', CustomUserCreateView.as_view(),
name='user-create'),
    # Other Djoser URLs...
]

On Thu, 15 Feb 2024 at 19:37, MISHEL HANNA <mishelhan...@gmail.com> wrote:

> hello
> i want to make api for register but i want modify the way of email
> activation
> in djoser to activate email it done by uuid/token but i do not want it to
> be done like that
> i want to activate the email by verification code
> do you have any suggestions or any other libraries i can use it
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b56f4747-d1dc-4009-aa5f-923530f1860fn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b56f4747-d1dc-4009-aa5f-923530f1860fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPRT2e5Vb1%3D4%2BLmH5oVg_FXPGspN9CB4cWwkO5qFZGngJJngCw%40mail.gmail.com.

Reply via email to