Ejemplo n.º 1
0
    def post():
        contact_form = ContactForm(request.POST)

        if contact_form.is_valid():
            contact_form.send_mail()
            messages.add_message(request, messages.SUCCESS, "Email Sent!")
            return redirect(request.path)

        c.update({'contact_form': contact_form})

        return render(request, 'pages/contact.html', c)