Live Project Link: https://dev-imageuploadapi.up.railway.app/api/v1/accounts/register/
This is based on the Django Rest Framework application that implements the all necessary logic to work with GSC (Google Cloud Storage), Redis, Celery and PostgreSQL. It does provide ONLY Django Rest Framework UI, so please follow the docs to see available URLS. I hope you not gonna spam my bucket :)
- Python 3.10
- Django 4.1.7
- Redis
- Celery
- Django REST 3.14
- Google Cloud Storage 2.7.0
- PostgreSQL 2.9.5
- Docker-compose
- Django-Alluth
- users can upload images via HTTP request
- users can list their uploaded images
- three builtin account tiers Basic, Premium and Enterprise- users that have a "Basic"plan after uploading an image get:- a link to a thumbnail that's 200px in height
 
- users that have a "Premium"plan get:- a link to a thumbnail that's 200px in height
 
- a link to a thumbnail that's 400px in height
- a link to the originally uploaded image
 
- users that have a "Enterprise"plan get- a link to a thumbnail that's 200px in height
- a link to a thumbnail that's 400px in height
- a link to the originally uploaded image
- the ability to fetch a link to the (binary) image that expires after several seconds (user can specify any number between 300 and 30000) and download it
 
 
- users that have a 
- apart from the builtin tiers, admins can create arbitrary tiers with the following things configurable:
- arbitrary thumbnail sizes
- presence of the link to the originally uploaded file
- ability to generate expiring links
 
- admin UI has been done via django-admin
- tests validation of the image and account tiers
- performance considerations(implemented basic cache for 15 seconds, distributed task queue to be able to process a lot of images)
PUBLIC URLS
- https://dev-imageuploadapi.up.railway.app/api/v1/accounts/register/
- https://dev-imageuploadapi.up.railway.app/api/v1/accounts/login/
ADMIN URLS
AUTHENTICATED USERS
- https://dev-imageuploadapi.up.railway.app/api/v1/images/
- https://dev-imageuploadapi.up.railway.app/api/v1/images/upload/
- https://dev-imageuploadapi.up.railway.app/api/v1/images/expiring-links/ (only Premium+ Account Tier)
ADVANCED API DOCS
- https://dev-imageuploadapi.up.railway.app/api/swagger/
- https://dev-imageuploadapi.up.railway.app/api/redoc/
First of all, you need to:
The easiest approach is to run docker-compose. It should work without any problems. The docker-compose approach is based on google cloud storage. If you have the desire to save locally the images and thumbnails please, visit this PR and see the changes.
- clone the repo
- go to the project folder
- run docker-compose up -d --build
- create a test super account with docker-compose exec backend python manage.py create_test_superuser
- visit (try both URLs in case the error occurred) localhost:8000/admin/or127.0.0.1:8000/admin/and paste the generated credentials
If you have any questions, let me know at [email protected]