code: def get_app_template_dir(app_name):
      
      if app_name in _cache:
          return _cache[app_name]
      template_dir = None
      for app in apps.get_app_configs():
          if app.label == app_name:
              template_dir = join(app.path, 'templates')
              break
      _cache[app_name] = template_dir
      return template_dir
docs: Get the template directory for an application
  
      Uses apps interface available in django 1.7+
  
      Returns a full path, or None if the app was not found.