Skip to main content

The django-minio-backend provides a wrapper around the MinIO Python Library.

Project description


The django-minio-backend provides a wrapper around the MinIO Python SDK.


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

  2. Add django_minio_backend to INSTALLED_APPS:

        'django_minio_backend',  # django-minio-backend |
  3. Add the following parameters to your

    from datetime import timedelta
    MINIO_ACCESS_KEY = 'yourMinioAccessKey'
    MINIO_SECRET_KEY = 'yourVeryS3cr3tP4ssw0rd'
    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),
  5. Initialize buckets & set public policy (OPTIONAL):
    This django-admin command creates both the private and public buckets in case one of them does not exists and sets the public bucket's privacy policy from private(default) to public.
    python initialize_buckets

    Code reference:

Health Check

To check the connection link between Django and MinIO, use the provided MinioBackend.is_minio_available() method.
It returns a MinioServerStatus instance which can be quickly evaluated as boolean.


minio_available = MinioBackend.is_minio_available()
if minio_available:

Reference Implementation

For a reference implementation, see Examples.


  • 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.


To build a new package, execute the following command: python sdist


  • theriverman/django-minio-backend licensed under the MIT License
  • minio/minio-py is licensed under the Apache License 2.0

Download files

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

Files for django-minio-backend, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size django-minio-backend-1.1.2.tar.gz (8.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page