19

I'm looking at the API for authentication

https://docs.djangoproject.com/en/1.3/topics/auth/

I can't seem to find information on simple user registration form that would send confirmation email as it is the usual way on web sites.

I guess I could do this:

1) Display a form 2) User enters info and submits 3) Save user as inactive, with a confirmation code 4) Send a link with confirmation code 5) User clicks a confirmation link and becomes active

It doesn't seem that difficult but I have a feeling this might be done already, and also there are quite a few edge cases that would need to be considered.

Ska
  • 6,658
  • 14
  • 53
  • 74

3 Answers3

28

It's not built into Django. There is a reusable app called django-allauth, which will fit your needs.

An app called django-registration used to be recommended, but that is now unmaintained and out of date.

Editor note: django-registration is not unmaintained as of December 2016.

kas
  • 857
  • 1
  • 15
  • 21
Torsten Engelbrecht
  • 13,318
  • 4
  • 46
  • 48
  • I'm also checking the Pinaxproject.com but it's a bit overwhelming. It does support registration among other useful things. – Ska Jun 28 '11 at 01:02
  • 3
    Pinax works, but from my experience, I do not recommend it. It is doing too many things in its own idiosyncratic way, and then if you ever want to change anything, you'd wish you'd have written it from scratch. – Sergey Orshanskiy Apr 17 '14 at 01:07
  • 1
    The app django-registration has maintenance in https://github.com/macropin/django-registration – Stratford Feb 06 '15 at 09:22
9

While django-registration used to be the registration system du jour, it has been abandoned by the maintainer and doesn't work on Django 1.6 without patching.

Try maybe django-allauth - I would have used it if I had known about it when I was looking. (As it turned out, I found this question first and used django-registration, wasting a lot of time.)

EDIT 10/2016: Looks like django-registration is maintained again. It's on GitHub now: https://github.com/ubernostrum/django-registration

dja
  • 1,453
  • 14
  • 20
  • Nice I was looking at the django-registration package; however it looked unmaintained, which made me wary. But django-allauth looks promising. – rectangletangle May 05 '14 at 22:38
0

You can do this:

  • Define a function to activate the user (i. e. def activate(request))
    • Configure in the url.py the route to that function (i.e /activate/)
  • Create a form to register user
  • Create the post function to create the user
    • When you create the user set field 'is_active' to 0.
    • In the same function send the email with a link inside, this link must have the target as the configured route
fsalazar_sch
  • 348
  • 2
  • 6
  • 17