擅长:python、mysql、java
<p>也许试试这个代码</p>
<pre><code>class AllauthCustomSignupView(SignupView):
def form_valid(self, form):
email = form.cleaned_data['email']
auth_user_list = [ 'email_1',
'email_2',
...
]
if email in auth_user_list:
return reverse('blocked-email') # whatever url, make sure that the url is defined inside form_valid or in approriate location.
else:
return super(AllauthCustomSignupView, self).form_valid(form)
class BlockedEmailView(TemplateView):
template_name = "blocked-email.html"
</code></pre>
<p>在您的网址.py在</p>
^{pr2}$
<p>此外,还需要更改SignupView所具有的表单的action属性。因此,您必须重写该视图的模板,保持其他所有内容不变,只需将操作更改为指向“signup/”。在</p>