I would like to allow a user to change his email address. A user would change his email address, then a confirmation email with a link would be sent to that address, after the user clicked the link it would change his email address in the database. 

I know there django-generic-confirmation deals with confirmations like this, but I would like to try and do it on my own.

To change an email, my code would be:

```
User.objects.get(username=username).update(email=request.POST['email'])

```

And to send an email to that address, I would have:

```
if 'Change Email' in request.POST.values():
    from django.core.mail import send_mail
    send_mail(
          'Confirm email change',
          'Click this **link** to confirm your change of email',
          'from@example.com',
          [request.POST['email']]
     )

```

How would I delay the change of email in the db until only after the user has confirmed his email? And how would i create a link that activates the email for this process? Thank you.