Can't get uuid value in email body in django

I have authentication app with email verification in it. I send an email like this: If registration form is valid then we save the form(create user) and set his token to uuid.uuid4.

class customer_register(CreateView):
    model = User
    form_class = CustomerSignUpForm
    template_name = 'authentication/customer_register.html'
    def form_valid(self, form):
        user =
        user.token = str(uuid.uuid4)
        subject = 'Verify your account | Zane'
        message = f"{user.token}/"

In my email arrives but it has some weird body:<function uuid4 at 0x103f32040>/

Please use str(uuid.uuid4()) instead of str(uuid.uuid4)

Back to Top