Added support for custom user model

use following code for support custom user model with fallback code if user is use django <1.5 version

try:
    from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
    from django.contrib.auth.models import User
else:
    User = get_user_model()