def show_debug_toolbar(request):
    """Custom function to determine whether to show the debug toolbar."""
    from django.conf import settings
    if request.is_ajax():
        return False
    return bool(settings.DEBUG and settings.DEBUG_TOOLBAR)
