Question: how to make an invitation link in Django? A link so the user kan register at my page? I want a link created wth a
how to make an invitation link in Django? A link so the user kan register at my page?
I want a link created wth a token
Here is my code so far
from django.shortcuts import render from coombboom.settings import EMAIL_HOST_USER from . import forms from django.core.mail import send_mail def invitation(request): sub = forms.Invitation() if request.method == 'POST': sub = forms.Invitation(request.POST) subject = 'Welcome' message = 'Here is your link to register: http://127.0.0.1:8000/account/register' recepient = str(sub['Email'].value()) send_mail(subject, message, EMAIL_HOST_USER, [recepient], fail_silently = False) return render(request, 'invitation/success.html', {'recepient': recepient}) return render(request, 'invitation/index.html', {'form':sub}) Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
