Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started