You'll want to go grab django-registration and call it a done: http://bitbucket.org/ubernostrum/django-registration/wiki/Home
This is a simple application which
provides flexible user registration
for Django-based projects. The default
setup implements a fairly common
workflow:
- User signs up for account.
- User receives an email containing instructions for activating
the account.
- User activates and begins using the site.
Docs on how to integrate and use it: http://bitbucket.org/ubernostrum/django-registration/src/tip/docs/overview.txt
It manages the reg key, timeout period and all processing for activating an account.
I have used this a few times with slight mods and it is very easy to get going testing using even a gmail account for sending to test.
Add this to your settings.py in the app to test with a gmail account:
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'YOURPASSWORD'
EMAIL_PORT = 587
Also, django-profiles is a great addition to this django-registration kit: http://bitbucket.org/ubernostrum/django-profiles/wiki/Home