<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_tgt_for(user):
 """ Fetch a ticket granting ticket for a given user. :param user: UserObj :return: TGT or Exepction """

    if not settings.CAS_PROXY_CALLBACK:
        raise CasConfigException("No proxy callback set in settings")

    try:
        return Tgt.objects.get(username=user.username)
    except ObjectDoesNotExist:
        logger.warning('No ticket found for user {user}'.format(
            user=user.username
        ))
        raise CasTicketException("no ticket found for user " + user.username)