django_gcp/storage/gcloud.py
def url(self, name):
        """
        Return public url or a signed url for the Blob.
        This DOES NOT check for existance of Blob - that makes codes too slow
        for many use cases.
        """
        name = self._normalize_name(clean_name(name))
        blob = self.bucket.blob(name)
        blob_params = self.get_object_parameters(name)
        no_signed_url = (
            blob_params.get("acl", self.settings.default_acl) == "publicRead" or not self.settings.querystring_auth
        )

        if not self.settings.custom_endpoint and no_signed_url:
            return blob.public_url
        elif no_signed_url:
            return "{storage_base_url}/{quoted_name}".format(
                storage_base_url=self.settings.custom_endpoint,
                quoted_name=_quote(name, safe=b"/~"),
            )
        elif not self.settings.custom_endpoint:
            return blob.generate_signed_url(expiration=self.settings.expiration, version="v4")
        else:
            return blob.generate_signed_url(
                bucket_bound_hostname=self.settings.custom_endpoint,
                expiration=self.settings.expiration,
                version="v4",
            )

        Return public url or a signed url for the Blob.
        This DOES NOT check for existance of Blob - that makes codes too slow
        for many use cases.
        
Return public url or a signed url for the Blob.
This DOES NOT check for existance of Blob - that makes codes too slow
for many use cases.
Return public url or a signed url for the Blob . This DOES NOT check for existance of Blob - that makes codes too slow for many use cases .
def url(self, name):
        name = self._normalize_name(clean_name(name))
        blob = self.bucket.blob(name)
        blob_params = self.get_object_parameters(name)
        no_signed_url = (
            blob_params.get("acl", self.settings.default_acl) == "publicRead" or not self.settings.querystring_auth
        )
        if not self.settings.custom_endpoint and no_signed_url:
            return blob.public_url
        elif no_signed_url:
            return "{storage_base_url}/{quoted_name}".format(
                storage_base_url=self.settings.custom_endpoint,
                quoted_name=_quote(name, safe=b"/~"),
            )
        elif not self.settings.custom_endpoint:
            return blob.generate_signed_url(expiration=self.settings.expiration, version="v4")
        else:
            return blob.generate_signed_url(
                bucket_bound_hostname=self.settings.custom_endpoint,
                expiration=self.settings.expiration,
                version="v4",
            )
def url ( self , name ) : name = self . _normalize_name ( clean_name ( name ) ) blob = self . bucket . blob ( name ) blob_params = self . get_object_parameters ( name ) no_signed_url = ( blob_params . get ( "acl" , self . settings . default_acl ) == "publicRead" or not self . settings . querystring_auth ) if not self . settings . custom_endpoint and no_signed_url : return blob . public_url elif no_signed_url : return "{storage_base_url}/{quoted_name}" . format ( storage_base_url = self . settings . custom_endpoint , quoted_name = _quote ( name , safe = b"/~" ) , ) elif not self . settings . custom_endpoint : return blob . generate_signed_url ( expiration = self . settings . expiration , version = "v4" ) else : return blob . generate_signed_url ( bucket_bound_hostname = self . settings . custom_endpoint , expiration = self . settings . expiration , version = "v4" , )
Return public url or a signed url for the Blob.
Return public url or a signed url for the Blob .
"""
        Return public url or a signed url for the Blob.
        This DOES NOT check for existance of Blob - that makes codes too slow
        for many use cases.
        """
self
name