code: def get_app_list(site, request):
      
      app_dict = _build_app_dict(site, request)
  
      # Sort the apps alphabetically.
      app_list = sorted(app_dict.values(), key=lambda x: x['name'].lower())
  
      # Sort the models alphabetically within each app.
      for app in app_list:
          app['models'].sort(key=lambda x: x['name'])
  
      return app_list
docs: Returns a sorted list of all the installed apps that have been
      registered in this site.