Skip to content

Commit 7503523

Browse files
committed
update
1 parent aa405fd commit 7503523

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,9 @@ Easier than ever!
347347

348348
Configure file-handling from inside your [model's file configuration](#file-handling-example), specify a few attributes in setings.py and that's it! No extra work, no nothing. All CRUD functionalities (uploads, downloads, deletions etc) including authentications, permissions, individual-accesses are handled automatically by `django-swiftapi`.
349349

350-
In settings.py, just specify according to your needs. `django-swiftapi` will use these directories to write or remove files:
351-
352350
#### For local storage
351+
In your settings.py:
352+
353353
```
354354
PUBLIC_LOCAL_FILE_WRITE_LOCATION = "" # ensure this directory is public in your production server, ex: 'dummy_site_files/public'
355355
PUBLIC_LOCAL_FILE_URL_PREFIX = "/media" # this prefix will be used in the file links, ex: '/media'
@@ -359,6 +359,10 @@ MEDIA_URL = '/media/' # the value '/media/' is necessary for serving files duri
359359
```
360360

361361
#### For AWS S3
362+
First, you need to install boto3 and set some configurations following AWS's official [docs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#installation)
363+
364+
Then in your settings.py, set these attributes:
365+
362366
```
363367
PUBLIC_AMAZONS3_BUCKET_NAME = ""
364368
PUBLIC_AMAZONS3_FILE_WRITE_LOCATION = ""
@@ -367,12 +371,13 @@ PRIVATE_AMAZONS3_BUCKET_NAME = ""
367371
PRIVATE_AMAZONS3_FILE_WRITE_LOCATION = ""
368372
MEDIA_URL = '/media/' # the value '/media/' is necessary for serving files during development according to django-docs
369373
```
374+
Done!
370375

371376
### File Operations
372377

373378
The system automatically provides these file operations:
374379

375-
- **Upload**: Files are uploaded during create/update operations
380+
- **Upload**: Files are uploaded during `create` or `update` operations
376381
- **Retrieve**: Download files via `/file/retrieve` endpoint
377382
- **Remove**: Delete specific files via `/files/remove` endpoint
378383

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='django_swiftapi',
5-
version='0.1.9',
5+
version='0.1.10',
66
description='Easy to use django package for building APIs quicker than ever, built on top of django-ninja-extra',
77
long_description=open('README.md').read(),
88
long_description_content_type='text/markdown',
@@ -16,7 +16,6 @@
1616
'ninja-schema',
1717
'django-ninja-extra',
1818
'django-allauth',
19-
'boto3',
2019
'asgiref',
2120
'Pillow',
2221
],

0 commit comments

Comments
 (0)