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=
Update the storage driver value to minio in .env
STORAGE_DRIVER=minio
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')
# storing file
path = storage.disk("minio").put_file('your_file_directory', file)
# getting file_url from storage
file_url = storage.disk("minio").get_secure_url(path)
return file_url
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minio_driver-0.1.6.tar.gz.
File metadata
- Download URL: minio_driver-0.1.6.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e4a1cdffbc41e4e361aeb76f49cb407a9ee6550d58c4538626b66eb90ba1fdf
|
|
| MD5 |
fee5c2dcfbdccd65541e1e4a6ab23a84
|
|
| BLAKE2b-256 |
8bc214af6dcf8e54c31e5e01c7a53b6f696b526e24f42453d1dc365a794fdd8e
|
File details
Details for the file minio_driver-0.1.6-py3-none-any.whl.
File metadata
- Download URL: minio_driver-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0376fdd8009112223ab6eab4e9215cbfc48eb5f499c7bf32da0fdf959aa2e3fa
|
|
| MD5 |
6f8eb14f5c17db37f1ec0a4c6db1652e
|
|
| BLAKE2b-256 |
4dcb9e0b293e3f7d02ad1a35f4276e210e99360c2b1df42e2e0af4071e6308a8
|