Django: How to login user directly after registration using generic CreateView
With django generic CreateView I can create a new user account, but how can I login this user automatically after registration using this technique? urls.py ... url( r'^signup/$', SignUpView.as_view(), name = 'user_signup' ), ... views.py class SignUpView ( CreateView ) : form_class = AccountCreationForm template_name = 'accounts/signup.html' success_url = reverse_lazy( 'home' ) forms.py class AccountCreationForm ( forms.ModelForm ) : def __init__( self, *args, **kwargs ) : super( AccountCreationForm, self ).__init__( *args, **kwargs ) for field in self.fields : self.fields[field].widget.attrs