code: def get_canonical_path(resource_key, pk=None):
          
  
          if resource_key not in resource_map:
              # Note: Maybe raise?
              return None
  
          base_path = get_script_prefix() + resource_map[resource_key]['path']
          if pk:
              return '%s/%s/' % (base_path, pk)
          else:
              return base_path
docs: Return canonical resource path.
  
          Arguments:
              resource_key - Canonical resource key
                             i.e. Serializer.get_resource_key().
              pk - (Optional) Object's primary key for a single-resource URL.
          Returns: Absolute URL as string.