Skip to content

Commit cc0a561

Browse files
committed
Add section about file upload in README
1 parent 73af42a commit cc0a561

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

.env.example

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ FILE_UPLOAD_STORAGE="local" # s3
66

77
AWS_S3_ACCESS_KEY_ID=""
88
AWS_S3_SECRET_ACCESS_KEY=""
9-
AWS_STORAGE_BUCKET_NAME="django-styleguide-example"
10-
AWS_S3_REGION_NAME="eu-central-1"
9+
AWS_STORAGE_BUCKET_NAME=""
10+
AWS_S3_REGION_NAME=""
11+
AWS_S3_CUSTOM_DOMAIN=""

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* [`HTTP Only` / `SameSite`](#http-only--samesite)
2727
* [Reading list](#reading-list)
2828
- [Example List API](#example-list-api)
29+
- [File uploads](#file-uploads)
2930
- [Helpful commands for local development without docker-compose](#helpful-commands-for-local-development-without-docker-compose)
3031
- [Helpful commands for local development with docker-compose](#helpful-commands-for-local-development-with-docker-compose)
3132
- [Deployment](#deployment)
@@ -229,6 +230,25 @@ Example data structure:
229230
}
230231
```
231232

233+
## File uploads
234+
235+
Following this article - <https://www.hacksoft.io/blog/direct-to-s3-file-upload-with-django> - there's a rich file-upload implementation in the Django Styleguide Example.
236+
237+
Everything is located in the `files` app.
238+
239+
Configuration wise, everything is located in [`config/settings/files_and_storages.py`](config/settings/files_and_storages.py)
240+
241+
Additionally, you can check the available options in [`.env.example`](.env.example)
242+
243+
Currently, the following is supported:
244+
245+
1. Standard local file upload.
246+
1. Standard S3 file upload.
247+
1. Using CloudFront as CDN.
248+
1. The so-called "direct" upload that can work both locally and with S3 (for more context, [check the article](https://www.hacksoft.io/blog/direct-to-s3-file-upload-with-django))
249+
250+
Feel free to use this as the basis of your file upload needs.
251+
232252
## Helpful commands for local development without docker-compose
233253

234254
To create Postgres database:

0 commit comments

Comments
 (0)