<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ip_geoloc(ip, hit_api=True):
 """ Get IP geolocation. Args: ip (str):
 IP address to use if no data provided. hit_api (bool):
 whether to hit api if info not found. Returns: str: latitude and longitude, comma-separated. """

    from ..logs.models import IPInfoCheck
    try:
        obj = IPInfoCheck.objects.get(ip_address=ip).ip_info
    except IPInfoCheck.DoesNotExist:
        if hit_api:
            try:
                obj = IPInfoCheck.check_ip(ip)
            except RateExceededError:
                return None
        else:
            return None
    return obj.latitude, obj.longitude