code: def load_tag_library(libname):
      
      from django.template.backends.django import get_installed_libraries
      from django.template.library import InvalidTemplateLibrary
      try:
          lib = get_installed_libraries()[libname]
          lib = importlib.import_module(lib).register
          return lib
      except (InvalidTemplateLibrary, KeyError):
          return None
docs: Load a templatetag library on multiple Django versions.
  
      Returns None if the library isn't loaded.