code: def get_admin_url(obj, page=None):
      
      if obj is None:
          return None
  
      if page is None:
          page = "change"
      if page not in ADMIN_ALL_PAGES:
          raise ValueError("Invalid page name '{}'. Available pages are: {}.".format(page, ADMIN_ALL_PAGES))
  
      app_label = obj.__class__._meta.app_label
      object_name = obj.__class__._meta.object_name.lower()
  
      if page in ADMIN_GLOBAL_PAGES:
          url_name = page
      else:
          url_name = "{}_{}_{}".format(app_label, object_name, page)
  
      if page == "app_list":
          url_args = (app_label,)
      elif page == "view_on_site":
          content_type = ContentType.objects.get_for_model(obj.__class__)
          url_args = (content_type, obj._get_pk_val())
      elif page in ADMIN_DETAIL_PAGES:
          url_args = (obj._get_pk_val(),)
      else:
          url_args = None
  
      return reverse("admin:{}".format(url_name), args=url_args)
docs: Return the URL to admin pages for this object.