login on activation with django-registration

1
2
3
4
def login_on_activation(sender, user, request, **kwargs):
    user.backend='django.contrib.auth.backends.ModelBackend' 
    login(request,user)
user_activated.connect(login_on_activation)

More like this

  1. Show logged users - keeping track of users login and logout by albertorcf 8 months, 2 weeks ago
  2. Registration with confirmation email by catellar 1 year, 9 months ago
  3. Using manager methods by ubernostrum 6 years, 2 months ago
  4. Django Registration without username by newmaniese 5 years, 1 month ago
  5. Django Registration with GMail account by btbytes 6 years, 1 month ago

Comments

ericcolon (on March 17, 2010):

I was just looking for this. Thanks.

#

robhudson (on March 23, 2010):

Just a note: This requires the unreleased version of django-registration. The version that's released on PyPI (and that you will get via pip), doesn't appear to emit signals.

#

rich00 (on December 10, 2010):

Need a little help? What is 'sender' in this function? My thoughts were to call this function from with the registration.activate view.

#

(Forgotten your password?)