forked from theriverman/django-minio-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(2.6.0b0) Project has been updated for MinIO SDK 7.0.0:
- New management command: is_minio_available - New property: MinioBackend.base_url - Dropped support for 2.1 and below - Minimum versions raised: - Django >= 2.2.2 - minio >= 7.0.0
- Loading branch information
1 parent
5ac4819
commit dae1720
Showing
6 changed files
with
53 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
django_minio_backend/management/commands/is_minio_available.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from django.core.management.base import BaseCommand, CommandError | ||
from django_minio_backend.models import MinioBackend | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Checks if the configured MinIO service is available.' | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument('--silenced', action='store_true', default=False, help='No console messages') | ||
|
||
def handle(self, *args, **options): | ||
m = MinioBackend('') # no configured bucket | ||
silenced = options.get('silenced') | ||
self.stdout.write(f"Checking the availability of MinIO at {m.base_url}\n") if not silenced else None | ||
|
||
available = m.is_minio_available() | ||
if not available: | ||
self.stdout.flush() | ||
raise CommandError(f'MinIO is NOT available at {m.base_url}\n' | ||
f'Reason: {available.details}') | ||
|
||
self.stdout.write(f'MinIO is available at {m.base_url}', ending='\n') if not silenced else None | ||
self.stdout.flush() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Django~=3.1.3 | ||
minio~=6.0.0,<7 | ||
Django>=2.2.2 | ||
minio>=7.0.0 | ||
Pillow | ||
setuptools~=50.3.2 | ||
setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,11 @@ | |
author_email='[email protected]', | ||
install_requires=[ | ||
'Django>=2.2.2', | ||
'minio>=4.0.9,<7' | ||
'minio>=7.0.0' | ||
], | ||
classifiers=[ | ||
'Environment :: Web Environment', | ||
'Framework :: Django', | ||
'Framework :: Django :: 2.0', | ||
'Framework :: Django :: 2.1', | ||
'Framework :: Django :: 2.2', | ||
'Framework :: Django :: 3.0', | ||
'Framework :: Django :: 3.1', | ||
|