0

I have simple form for create new user in Django.

Also I want that request (from user) forward to the administrator's email, and just admin can enable that account. User has to wait respond from admin. If admin enable that account, user is going to be able to use account!

Alireza Savand
  • 3,462
  • 3
  • 26
  • 36
prog.Dusan
  • 1,324
  • 2
  • 12
  • 25

1 Answers1

1

Create the user with is_active = False, Then you can easily filter those user on django admin panel. Or you can use django signal such as post_save signal to send an email to administrator's email, email can be included with an activation link which is unique for activating the user. You can create a separate model to keep inactivated user and for each record generate an random-hashed key. You can use that random-hashed key (token) in activation link that you sending to administrator's email.

There is already some application that let you to handle registration, for example django-registration. But your case it little bit tricky. Because you want to admin be able to activate those users. So I suggest you to look at django-registration source code. It's so clear and easy to understand. Just read the code and you will get the point.

Alireza Savand
  • 3,462
  • 3
  • 26
  • 36
  • I prefer second way. It is more elegant, but can you pass me some example, cuz i am really new Django programmer. :) – prog.Dusan Mar 26 '13 at 18:43