def cas_login(request, next_page=None, required=False):
 ret = django_cas_login(request, next_page, required)
 if request.user.is_authenticated():
  user = request.user
  UserProfile.objects.get_or_create(user=user, defaults={'name': user.username})
 return ret

def cas_login ( request , next_page = None , required = False ) : ret = django_cas_login ( request , next_page , required ) if request . user . is_authenticated ( ) : user = request . user UserProfile . objects . get_or_create ( user = user , defaults = { 'name' : user . username } ) return ret
uses django_cas for authentication .