django-minio-connector


Namedjango-minio-connector JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/max-dev-py/django-minio-connector
SummaryDjango storage backend to use MinIO as file storage. It is wrapper over "minio" library.
upload_time2024-10-31 19:20:31
maintainerNone
docs_urlNone
authorMaxim Ustinov
requires_python>=3.11
licenseApache License 2.0
keywords django storage minio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Django Minio Connector
====================
Django storage backend to use [Minio Server](https://github.com/minio/minio) as file storage. It is wrapper over "minio" library.

Installation
-----------
At first, you need to have working minio server. How to do that you can found at [Minio Quickstart Guide](http://docs.minio.io/docs/minio-quickstart-guide).

Install Django Minio Storage from pip:
```
pip install django-minio-connector
```

Add configuration of Minio storage to your projects settings file:
```
from django_minio_connector import MinIOStorage

STORAGES = {
    "staticfiles": {
        "BACKEND": MinIOStorage,
        "OPTIONS": {
            "MINIO_ENDPOINT": 'your_minio_server_address',
            "MINIO_ROOT_USER": "your_minio_server_access_key",
            "MINIO_ROOT_PASSWORD": "your_minio_server_secret_key",
            'MINIO_USE_HTTPS': False,
            'MINIO_BUCKET_NAME': 'static-bucket-name',
            'MINIO_BUCKET_POLICY': {
                "Version": "2012-10-17",
                "Statement": [
                    {
                        "Effect": "Allow",
                        "Principal": {"AWS": "*"},
                        "Action": [
                            "s3:GetBucketLocation",
                            "s3:ListBucket"
                        ],
                        "Resource": f"arn:aws:s3:::static"
                    },
                    {
                        "Effect": "Allow",
                        "Principal": {"AWS": "*"},
                        "Action": "s3:GetObject",
                        "Resource": f"arn:aws:s3:::static/*"
                    }
                ]
            },
            'MINIO_PRESIGNED_URL': False,
        },
    },
    'default': {
        'BACKEND': MinIOStorage,
        "OPTIONS": {
            "MINIO_ENDPOINT": 'your_minio_server_address',
            "MINIO_ROOT_USER": "your_minio_server_access_key",
            "MINIO_ROOT_PASSWORD": "your_minio_server_secret_key",
            'MINIO_USE_HTTPS': False,
            'MINIO_BUCKET_NAME': 'media-bucket-name',
        },

    }
}
```
For using MinIO server in development stage could install it by Docker [MinIO Quickstart Guide](https://hub.docker.com/r/minio/minio)

Demo MinIO server and it's credentials can be found at [MinIO console](https://min.io/docs/minio/linux/administration/minio-console.html#logging-in).

MinIO library documentation [Python Client API Reference](https://min.io/docs/minio/linux/developers/python/API.html)

More information about file storages can be found at [Django Docs](https://docs.djangoproject.com/en/5.1/ref/files/storage/).

Description of STORAGE settings [Settings](https://docs.djangoproject.com/en/5.1/ref/settings/#storages)

Currently tested only at Django 5.1. Does not work on earlier versions because the DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings is removed.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/max-dev-py/django-minio-connector",
    "name": "django-minio-connector",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "django storage minio",
    "author": "Maxim Ustinov",
    "author_email": "MaximVUstinovk@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b8/33/97397de77356e77ee2982af18a77e47191039ad0f00f6d4e5393c7d4a522/django_minio_connector-0.0.2.tar.gz",
    "platform": null,
    "description": "Django Minio Connector\n====================\nDjango storage backend to use [Minio Server](https://github.com/minio/minio) as file storage. It is wrapper over \"minio\" library.\n\nInstallation\n-----------\nAt first, you need to have working minio server. How to do that you can found at [Minio Quickstart Guide](http://docs.minio.io/docs/minio-quickstart-guide).\n\nInstall Django Minio Storage from pip:\n```\npip install django-minio-connector\n```\n\nAdd configuration of Minio storage to your projects settings file:\n```\nfrom django_minio_connector import MinIOStorage\n\nSTORAGES = {\n    \"staticfiles\": {\n        \"BACKEND\": MinIOStorage,\n        \"OPTIONS\": {\n            \"MINIO_ENDPOINT\": 'your_minio_server_address',\n            \"MINIO_ROOT_USER\": \"your_minio_server_access_key\",\n            \"MINIO_ROOT_PASSWORD\": \"your_minio_server_secret_key\",\n            'MINIO_USE_HTTPS': False,\n            'MINIO_BUCKET_NAME': 'static-bucket-name',\n            'MINIO_BUCKET_POLICY': {\n                \"Version\": \"2012-10-17\",\n                \"Statement\": [\n                    {\n                        \"Effect\": \"Allow\",\n                        \"Principal\": {\"AWS\": \"*\"},\n                        \"Action\": [\n                            \"s3:GetBucketLocation\",\n                            \"s3:ListBucket\"\n                        ],\n                        \"Resource\": f\"arn:aws:s3:::static\"\n                    },\n                    {\n                        \"Effect\": \"Allow\",\n                        \"Principal\": {\"AWS\": \"*\"},\n                        \"Action\": \"s3:GetObject\",\n                        \"Resource\": f\"arn:aws:s3:::static/*\"\n                    }\n                ]\n            },\n            'MINIO_PRESIGNED_URL': False,\n        },\n    },\n    'default': {\n        'BACKEND': MinIOStorage,\n        \"OPTIONS\": {\n            \"MINIO_ENDPOINT\": 'your_minio_server_address',\n            \"MINIO_ROOT_USER\": \"your_minio_server_access_key\",\n            \"MINIO_ROOT_PASSWORD\": \"your_minio_server_secret_key\",\n            'MINIO_USE_HTTPS': False,\n            'MINIO_BUCKET_NAME': 'media-bucket-name',\n        },\n\n    }\n}\n```\nFor using MinIO server in development stage could install it by Docker [MinIO Quickstart Guide](https://hub.docker.com/r/minio/minio)\n\nDemo MinIO server and it's credentials can be found at [MinIO console](https://min.io/docs/minio/linux/administration/minio-console.html#logging-in).\n\nMinIO library documentation [Python Client API Reference](https://min.io/docs/minio/linux/developers/python/API.html)\n\nMore information about file storages can be found at [Django Docs](https://docs.djangoproject.com/en/5.1/ref/files/storage/).\n\nDescription of STORAGE settings [Settings](https://docs.djangoproject.com/en/5.1/ref/settings/#storages)\n\nCurrently tested only at Django 5.1. Does not work on earlier versions because the DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings is removed.\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Django storage backend to use MinIO as file storage. It is wrapper over \"minio\" library.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/max-dev-py/django-minio-connector"
    },
    "split_keywords": [
        "django",
        "storage",
        "minio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d82676b859a3b9d6464b9aba168bf2fd69a60649df3233a4e939b85e54550de",
                "md5": "a279d6bd4d07134dfce08cf43071b2dc",
                "sha256": "8962deb7b30c2272ce830a476cdc627fe5ff56e6d446a65942f617d22b65cde8"
            },
            "downloads": -1,
            "filename": "django_minio_connector-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a279d6bd4d07134dfce08cf43071b2dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 6724,
            "upload_time": "2024-10-31T19:20:30",
            "upload_time_iso_8601": "2024-10-31T19:20:30.702721Z",
            "url": "https://files.pythonhosted.org/packages/1d/82/676b859a3b9d6464b9aba168bf2fd69a60649df3233a4e939b85e54550de/django_minio_connector-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b83397397de77356e77ee2982af18a77e47191039ad0f00f6d4e5393c7d4a522",
                "md5": "d275416b90f756e3cb16333d993cd3e6",
                "sha256": "9d6bb59a95838e5d50c9bf622f2b30a3ce5413ae4d4109a8bf43dbc3eebbb4e7"
            },
            "downloads": -1,
            "filename": "django_minio_connector-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d275416b90f756e3cb16333d993cd3e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 6349,
            "upload_time": "2024-10-31T19:20:31",
            "upload_time_iso_8601": "2024-10-31T19:20:31.878257Z",
            "url": "https://files.pythonhosted.org/packages/b8/33/97397de77356e77ee2982af18a77e47191039ad0f00f6d4e5393c7d4a522/django_minio_connector-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-31 19:20:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "max-dev-py",
    "github_project": "django-minio-connector",
    "github_not_found": true,
    "lcname": "django-minio-connector"
}
        
Elapsed time: 0.37431s