How can I have Django user registration single step (instead of two step)process with email compulsory?

后端 未结 2 1712
不思量自难忘°
不思量自难忘° 2021-01-03 12:31

I want Django to send an email to user email-address with Login details once admin adds a new user to admin site.So I tried using Django signals for that but just becoz djan

2条回答
  •  独厮守ぢ
    2021-01-03 13:02

    From this example try defining email in your custom UserCreationForm as required=True:

    class MyUserCreationForm(UserCreationForm):
        email = forms.EmailField(required=True)
    
        class Meta:
            model = User
            fields = ('username', 'email',)
    

提交回复
热议问题