https://github.com/py-package/minio-masonite-driver
Minio Storage Driver for Masonite
https://github.com/py-package/minio-masonite-driver
driver filesystem masonite masonite-package package storage
Last synced: 2 months ago
JSON representation
Minio Storage Driver for Masonite
- Host: GitHub
- URL: https://github.com/py-package/minio-masonite-driver
- Owner: py-package
- License: mit
- Created: 2021-10-25T11:33:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-15T10:45:03.000Z (over 3 years ago)
- Last Synced: 2025-04-23T14:14:24.379Z (2 months ago)
- Topics: driver, filesystem, masonite, masonite-package, package, storage
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#### Project description
**What is Minio-Driver?**
It's an extra storage driver support for Minio in masonite 4.
**Setup**
Install package using pip:
```shell
pip install minio-driver
```Add provider inside config/providers.py.
```python
from minio_driver.MinioProvider import MinioProviderPROVIDERS = [
...,
# Application Providers
MinioProvider,
]
```**Storage Config**
Add following configuration inside config/filesystem.py after `"s3": {...},`
```python
"minio": {
"driver": "minio",
"client": env("MINIO_CLIENT"),
"secret": env("MINIO_SECRET"),
"bucket": env("MINIO_BUCKET"),
"path": env("MINIO_ENDPOINT"),
},
```Add following keys in `.env`.
```shell
MINIO_CLIENT=
MINIO_SECRET=
MINIO_BUCKET=
MINIO_ENDPOINT=
```Update the storage driver value to `minio` in `.env`
```shell
STORAGE_DRIVER=minio
```**Example**
```python
from masonite.controllers import Controller
from masonite.filesystem import Storage
from masonite.request import Requestclass 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 ;)