Minio Storage Driver for Masonite
Project description
Project description
What is Minio-Driver? It's an extra storage driver support for Minio in masonite 4.
Setup
Install package using pip:
pip install minio-driver
Add provider inside config/providers.py.
from minio_driver.MinioProvider import MinioProvider
PROVIDERS = [
...,
# Application Providers
MinioProvider,
]
Storage Config
Add following configuration inside config/filesystem.py after "s3": {...},
"minio": {
"driver": "minio",
"client": env("MINIO_CLIENT"),
"secret": env("MINIO_SECRET"),
"bucket": env("MINIO_BUCKET"),
"path": env("MINIO_ENDPOINT"),
},
Add following keys in .env
.
MINIO_CLIENT=
MINIO_SECRET=
MINIO_BUCKET=
MINIO_ENDPOINT=
Example
from masonite.controllers import Controller
from masonite.filesystem import Storage
from masonite.request import Request
class YourController(Controller):
def your_function(self, request: Request, storage: Storage):
file = request.input('file')
path = storage.disk("minio").put_file('your_file_directory', file)
return path
Enjoy ;)
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
minio_driver-0.1.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for minio_driver-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd92ccdd299b650ee0bd31218a55e00b6f670b132ed42c8ba30640b1de6d58a3 |
|
MD5 | 2d89eba0d572236434047361e19515f3 |
|
BLAKE2b-256 | 2d62f1321c7895f41662db592b401866bfa06813dcee631b3a32ded2e709fabd |