简体   繁体   English

使用django_registration进行选择性用户注册?

[英]Selective user registration using django_registration?

I have a site catering to multiple clubs, and each club has administrators who maintain a database of club members. 我有一个可以满足多个俱乐部需求的网站,每个俱乐部都有管理者维护着俱乐部成员数据库。 I want to limit site registration only to members who have explicitly been added to the club's database. 我只想将网站注册仅限于已明确添加到俱乐部数据库中的会员。 How do I go about auto-generating and sending out registration links to members as they are added to the database? 当成员添加到数据库时,如何自动生成和发送注册链接给成员? In other words, I want registration to be initiated only by club administrators. 换句话说,我希望注册仅由俱乐部管理员发起。

You said you have a database of club members already, so you must have a primary key or a tuple which is unique for that database like a club registration number which club members should know already 您说您已经有一个俱乐部会员数据库,所以您必须拥有一个该数据库唯一的主键或元组,例如俱乐部会员应该已经知道的俱乐部注册号

  1. Tell Users to give there primary key value( club registration number ) at the time of registration. 告诉用户在注册时提供主键值( 俱乐部注册号 )。
  2. Make that club registration number also as a primary key to the new database which you are creating after registration for the user, next time if some body will re-use that club registration number to re-register then It will fail as the database tuple will already be there associated with that club registration number 将俱乐部注册号也用作您为用户注册后创建的新数据库的主键,下次如果某个机构将重新使用该俱乐部注册号进行重新注册,则它将失败,因为数据库元组将失败已经与该俱乐部注册号相关联
  3. Also have a warning message at the time of registration that you can use one club registration number for one registration only for the site. 在注册时也有一条警告消息, 即您只能将一个俱乐部注册号用于该站点的一次注册。

To limit registrations to people already in the database, you will need some way to identify them. 要将注册限制为数据库中已有的人员,您将需要某种方式来识别他们。

  1. Require the club administrator to enter an email address for each member entered. 要求俱乐部管理员为输入​​的每个成员输入电子邮件地址。
  2. Require the user to supply that address when registering. 注册时要求用户提供该地址。
  3. Send the registration link to that address, including the primary key of the user record in the link. 将注册链接发送到该地址,包括链接中用户记录的主键。
  4. When the user clicks the link, in your django view examine the link and make sure the key matches, then complete the registration. 当用户单击链接时,在您的django视图中检查链接并确保密钥匹配,然后完成注册。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM