<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def allow_ajax(request):
 """ Default function to determine whether to show the toolbar on a given page. """

    if request.META.get('REMOTE_ADDR', None) not in settings.INTERNAL_IPS:
        return False
    if toolbar_version < LooseVersion('1.8') \
            and request.get_full_path().startswith(DEBUG_TOOLBAR_URL_PREFIX) \
            and request.GET.get('panel_id', None) != 'RequestHistoryPanel':
        return False
    return bool(settings.DEBUG)