Skip to content

Instantly share code, notes, and snippets.

@jie
Created March 14, 2011 11:37
Show Gist options
  • Select an option

  • Save jie/869027 to your computer and use it in GitHub Desktop.

Select an option

Save jie/869027 to your computer and use it in GitHub Desktop.
django:login new user after signup
from django.contrib import auth
from django.contrib.auth.forms import UserCreationForm
form = UserCreationForm()
new_user=form.save()
new_user.backend="%s.%s" %('django.contrib.auth.backends','ModelBackend')
auth.login(request, new_user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment