def is_request_from_mobile_app(request):
 if is_request_from_mobile_web_view(request):
  return True
 if getattr(settings, 'MOBILE_APP_USER_AGENT_REGEXES', None):
  user_agent = request.META.get('HTTP_USER_AGENT')
  if user_agent:
   for user_agent_regex in settings.MOBILE_APP_USER_AGENT_REGEXES:
    if re.search(user_agent_regex, user_agent):
     return True
 return False

def is_request_from_mobile_app ( request ) : if is_request_from_mobile_web_view ( request ) : return True if getattr ( settings , 'MOBILE_APP_USER_AGENT_REGEXES' , None ) : user_agent = request . META . get ( 'HTTP_USER_AGENT' ) if user_agent : for user_agent_regex in settings . MOBILE_APP_USER_AGENT_REGEXES : if re . search ( user_agent_regex , user_agent ) : return True return False
returns whether the given request was made by an open edx mobile app .