The django-minio-backend provides a wrapper around the MinIO Python Library.
Project description
django-minio-backend
The django-minio-backend
provides a wrapper around the
MinIO Python Library.
Integration
-
Get and install the package:
pip install django-minio-backend
-
Add
django_minio_backend
toINSTALLED_APPS
:INSTALLED_APPS = [ '...' 'django_minio_backend', # django-minio-backend ]
-
Add the following parameters to your
settings.py
:from datetime import timedelta MINIO_ENDPOINT = 'minio.yourcompany.co.uk' MINIO_ACCESS_KEY = 'yourMinioAccessKey' MINIO_SECRET_KEY = 'yourVeryS3cr3tP4ssw0rd' MINIO_USE_HTTPS = True MINIO_PRIVATE_BUCKET_NAME = 'my-app-private' MINIO_PUBLIC_BUCKET_NAME = 'my-app-public' MINIO_URL_EXPIRY_HOURS = timedelta(days=1)
-
Implement your own Attachment handler and integrate django-minio-backend:
from django.db import models from django_minio_backend import MinioBackend, iso_date_prefix # noinspection PyUnresolvedReferences class PrivateAttachment(models.Model): file = models.FileField(verbose_name="Object Upload", storage=MinioBackend(is_public=False), upload_to=iso_date_prefix)
Reference Implementation
For a reference implementation, see Examples.
Compatibility
- Django 2.0 or later
- Python 3.5.0 or later Note: This library relies heavily on PEP 484 -- Type Hints which was introduced in Python 3.5.0.
Contribution
To build a new package, execute the following command:
python setup.py sdist
Copyright
theriverman/django-minio-backend licensed under the MIT License minio/minio-py is licensed under the Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-minio-backend-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66412c6d140e63d5eb85dc4d09d6a960bca96d251b4238ec027a47eb25aedf12 |
|
MD5 | 0fb1f30084d3b96292cdc5a47b4eb4f7 |
|
BLAKE2b-256 | 4b72f3d9fb7da00bdfd730355dda6a41e6609879635abe1a0973921703e249d0 |
Close
Hashes for django_minio_backend-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db405562ac72836e38b63f889ba53e03ac9eaac36d7df03273114bc8e7702627 |
|
MD5 | 2b8e14c47bca0202082df0f2e32d1bb9 |
|
BLAKE2b-256 | 0b9a61724e80ed98cd702a705aeb331f5b0e15645d7219059125a0a0f625a6e9 |