repos

isaacbythewood.com-nextjs

mirror archived upstream

Animation-heavy personal portfolio on Next.js: a custom cursor, a page-transition loader, and canvas backgrounds.

canvas-animationscss-modulesdark-themehandcodednextjspersonal-websiteportfolioreact

650 B · 24 lines · Python Raw History
 1from django.template.response import TemplateResponse
 2from django.core.mail import send_mail
 3
 4
 5def home(request):
 6    context = {
 7        'submitted': False,
 8    }
 9
10    if request.method == 'POST':
11        subject = 'Pony From isaacbythewood.com'
12        message = request.POST['message']
13        sender = 'Robot <[email protected]>'
14        recipient = ['[email protected]']
15
16        # send_mail is deprecated and I need to start using EmailMessage instead
17        send_mail(subject, message, sender, recipient)
18        
19        context['submitted'] = True
20
21    template = 'core/home.html'
22
23    return TemplateResponse(request, template, context)