How to use the cog.settings.development function in cog

To help you get started, we’ve selected a few cog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geobeyond / cog / app / models.py View on Github external
def set_bucket_name_and_resource_uri(self):
        # generate bucket_name
        if 'development' in os.getenv('DJANGO_SETTINGS_MODULE'):
            bucketname = development.MINIO_STORAGE_COG_BUCKET_NAME
        else:
            bucketname = production.MINIO_STORAGE_COG_BUCKET_NAME
        # generate uri from minio
        if 'development' in os.getenv('DJANGO_SETTINGS_MODULE'):
            minio_baseurl = development.MINIO_STORAGE_COG_URL
        else:
            minio_baseurl = production.MINIO_STORAGE_COG_URL
        uri = urljoin(
            minio_baseurl,
            os.path.join(bucketname, self.name)
        )
        COG.objects.filter(
            id=self.id
        ).update(
            bucket_name=bucketname,
            resource_uri=uri
        )
github geobeyond / cog / app / models.py View on Github external
def set_bucket_name_and_resource_uri(self):
        # generate bucket_name
        if 'development' in os.getenv('DJANGO_SETTINGS_MODULE'):
            bucketname = development.MINIO_STORAGE_COG_BUCKET_NAME
        else:
            bucketname = production.MINIO_STORAGE_COG_BUCKET_NAME
        # generate uri from minio
        if 'development' in os.getenv('DJANGO_SETTINGS_MODULE'):
            minio_baseurl = development.MINIO_STORAGE_COG_URL
        else:
            minio_baseurl = production.MINIO_STORAGE_COG_URL
        uri = urljoin(
            minio_baseurl,
            os.path.join(bucketname, self.name)
        )
        COG.objects.filter(
            id=self.id
        ).update(
            bucket_name=bucketname,
            resource_uri=uri