How to set-up django-registration that an account needs to be manually activated by an admin?
After the account-holder clicks in the link in the e-mail I would like that an e-mail is sent to the admin, and he also needs to click a link and only then the account would be active.
Is it possible with django-registration, or do I need to use something else, and what to use?
django-registration allows you to write a custom backend to handle custom activation needs.
So what you’d do is create your own backend, implementing the
registerandactivateyourself.Here’s an example of how you could implement the
registerfunction:The key point is to make sure
send_emailis set to false; that will prevent the user from getting an activation link. Then you can decide whether the email sent to the admins has an activation link or if you’re content with them going to admin and just checking the “Active” box.If you use
AuthenticationFormfromdjango.contrib.auththen it will automatically reject users whoseis_activeis False, but if you’re not using that then make sure to run the following check for any request where an active user is required:You can also write your own decorator (look at
@login_requiredfor pointers). Note that@login_requireddoes not check foris_active.