Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slyapustin/django-s3-like-storage
Your Own Amazon S3 Django Storage
https://github.com/slyapustin/django-s3-like-storage
amazon aws aws-s3 django static
Last synced: about 2 months ago
JSON representation
Your Own Amazon S3 Django Storage
- Host: GitHub
- URL: https://github.com/slyapustin/django-s3-like-storage
- Owner: slyapustin
- License: mit
- Created: 2019-07-06T00:54:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-02T22:23:49.000Z (about 1 year ago)
- Last Synced: 2024-08-01T06:21:28.196Z (5 months ago)
- Topics: amazon, aws, aws-s3, django, static
- Language: Python
- Homepage: https://itnext.io/how-i-build-my-own-amazon-s3-storage-5de56b4c6612
- Size: 35.2 KB
- Stars: 46
- Watchers: 5
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Your Own Amazon S3 Server
This application replicate basic Amazon S3 functionality:
- Ability to have multiple Buckets with own credentials
- Upload files with public read-only accessMain purpose of that application is to store Media and Static files of Django applications outside of the application instance.
That is especially useful if your deploy application to the cloud providers (for ex. Heroku) which does not offer storage option.## Deployment
- Create an `.env` file based on the `.env.example`
- Build and run app via Docker: `docker-compose up -d` (if you on Apple Silicon, you need to do `export DOCKER_DEFAULT_PLATFORM=linux/amd64` first)
- Create an Administrator account: `docker-compose exec app python ./manage.py createsuperuser`## Using in your Application
In order to use that storage at your Django projects you may need use `django-storages` package, in that case some extra settings required.
```python
# Usual AWS S3 Configuration
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME']# Some extra setings
AWS_S3_ENDPOINT_URL='https://your.app.instance.com' # Your App Endpoint
AWS_QUERYSTRING_AUTH = False
AWS_DEFAULT_ACL='public-read'
```### Demo project
Demo project, which utilize that app available [here](https://github.com/slyapustin/django-classified-demo).