Skip to main content

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

  1. Get and install the package: pip install django-minio-backend

  2. Add django_minio_backend to INSTALLED_APPS:

    INSTALLED_APPS = [
    '...'
    'django_minio_backend',  # django-minio-backend
    ]
    
  3. 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)
    
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-minio-backend-0.0.4.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file django-minio-backend-0.0.4.tar.gz.

File metadata

  • Download URL: django-minio-backend-0.0.4.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for django-minio-backend-0.0.4.tar.gz
Algorithm Hash digest
SHA256 adbb701eaea92dd97172f859ecea7a0f9f09fd3903513916c0f63aba2121ef86
MD5 ab33ad4aadcfb0f5808d6135dbfc772e
BLAKE2b-256 0f17cc9b77cd73cc5118e29b46b87d6ed0ec3c261bba5cf00a3825c5cea9bcc4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page