|
9 | 9 |
|
10 | 10 | --- |
11 | 11 |
|
| 12 | +**Table of contents:** |
| 13 | + |
| 14 | +<!-- toc --> |
| 15 | + |
| 16 | +- [General API Stuff](#general-api-stuff) |
| 17 | + * [CORS](#cors) |
| 18 | +- [Authentication - JWT](#authentication---jwt) |
| 19 | + * [Settings](#settings) |
| 20 | + * [APIs](#apis) |
| 21 | + * [Requiring authentication](#requiring-authentication) |
| 22 | +- [Authentication - Sessions](#authentication---sessions) |
| 23 | + * [DRF & Overriding `SessionAuthentication`](#drf--overriding-sessionauthentication) |
| 24 | + * [Cross origin](#cross-origin) |
| 25 | + * [APIs](#apis-1) |
| 26 | + * [`HTTP Only` / `SameSite`](#http-only--samesite) |
| 27 | + * [Reading list](#reading-list) |
| 28 | +- [Example List API](#example-list-api) |
| 29 | +- [File uploads](#file-uploads) |
| 30 | +- [Helpful commands for local development without docker-compose](#helpful-commands-for-local-development-without-docker-compose) |
| 31 | +- [Helpful commands for local development with docker-compose](#helpful-commands-for-local-development-with-docker-compose) |
| 32 | +- [Deployment](#deployment) |
| 33 | + * [Heroku](#heroku) |
| 34 | + * [AWS ECS](#aws-ecs) |
| 35 | + |
| 36 | +<!-- tocstop --> |
| 37 | + |
| 38 | +--- |
| 39 | + |
12 | 40 | This project serves as an [example of our styleguide](https://github.com/HackSoftware/Django-Styleguide) |
13 | 41 |
|
14 | 42 | The structure is inspired by [cookiecutter-django](https://github.com/pydanny/cookiecutter-django) and modified based on our experience with Django. |
@@ -202,6 +230,25 @@ Example data structure: |
202 | 230 | } |
203 | 231 | ``` |
204 | 232 |
|
| 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 | + |
205 | 252 | ## Helpful commands for local development without docker-compose |
206 | 253 |
|
207 | 254 | To create Postgres database: |
|
0 commit comments