You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compat.py 506B

1234567891011121314151617181920
  1. from django.conf import settings
  2. def get_user_model():
  3. """
  4. Using this function instead of Django 1.5's get_user_model allows backwards
  5. compatibility with Django 1.4.
  6. """
  7. try:
  8. # Django 1.5+
  9. from django.contrib.auth import get_user_model
  10. except ImportError:
  11. # Django <= 1.4
  12. from django.contrib.auth.models import User
  13. return User
  14. else:
  15. return get_user_model()
  16. AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')