Skip to content

Instantly share code, notes, and snippets.

@dgouldin
Created November 20, 2012 20:35
Show Gist options
  • Save dgouldin/4120897 to your computer and use it in GitHub Desktop.
Save dgouldin/4120897 to your computer and use it in GitHub Desktop.
Get django's auth user model in a backwards compatible way
try:
from django.contrib.auth import get_user_model
except ImportError:
from django.contrib.auth.models import User as UserModel
else:
UserModel = get_user_model()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment