{"id":37064172,"url":"https://github.com/kokospapa8/django-async-image-upload","last_synced_at":"2026-01-14T07:29:57.845Z","repository":{"id":57418979,"uuid":"374436440","full_name":"kokospapa8/django-async-image-upload","owner":"kokospapa8","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-10T20:21:44.000Z","size":702,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-01T07:10:41.851Z","etag":null,"topics":["bucket","django","django-api","thumbnail"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kokospapa8.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-06T18:35:02.000Z","updated_at":"2021-12-18T11:55:46.000Z","dependencies_parsed_at":"2022-09-13T15:24:54.497Z","dependency_job_id":null,"html_url":"https://github.com/kokospapa8/django-async-image-upload","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kokospapa8/django-async-image-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokospapa8%2Fdjango-async-image-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokospapa8%2Fdjango-async-image-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokospapa8%2Fdjango-async-image-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokospapa8%2Fdjango-async-image-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kokospapa8","download_url":"https://codeload.github.com/kokospapa8/django-async-image-upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokospapa8%2Fdjango-async-image-upload/sbom","scorecard":{"id":566249,"data":{"date":"2025-08-11","repo":{"name":"github.com/kokospapa8/django-async-image-upload","commit":"3900800fca96a3367e0cde59a49b68370773e976"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2020-263 / GHSA-fx83-3ph3-9j2q","Warn: Project is vulnerable to: GHSA-gw84-84pc-xp82","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6","Warn: Project is vulnerable to: PYSEC-2022-238 / GHSA-h3qr-fjhm-jphw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T15:03:19.056Z","repository_id":57418979,"created_at":"2025-08-20T15:03:19.056Z","updated_at":"2025-08-20T15:03:19.056Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bucket","django","django-api","thumbnail"],"created_at":"2026-01-14T07:29:57.350Z","updated_at":"2026-01-14T07:29:57.833Z","avatar_url":"https://github.com/kokospapa8.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django-async-image-upload\n\nAsync image upload using presigned url for Django.\n\nThis module provide async processing capability using cloud architecture for Django server. \nUsing this module, you can decouple code from Django api server and easily extend image processing capability.\n\nThere are already plenty of good thumbnail packages such as [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail), \n[django-imagekit](https://github.com/matthewwithanm/django-imagekit).\nHowever most of the packages process image on django server. Some are partially asynchrounous with celery and other technique, but server still needs to recieve files from client to proecess them.\n\nUsing S3(and others storages in the futures) presigned-url feature, client can directly uploads to S3 without involving backend server.\nOnce image is uploaded, api server gets callback once image processing in finished elsewhere(serverless function in this case.\n\n## TODO\nCurrent version only provide asynchronous upload with lambda function. There are a lot more to do with this module.\n- Unittest and github action \n- Multiple presigned url creation \n- Support for Django 2.X (Jsonfield)\n- Support for azure, gcp\n\n* In order to use this module you need to deploy [cloud counter part](https://github.com/kokospapa8/cloud-async-image-upload).\n** Current version only support AWS. \n\n# Architecture (AWS)\n![flow](resources/flow.png)\n\n1. Client request for `presigned url` for image upload.\n2. Server generate [Presigned URL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html) for upload. \n3. Server returns presigned url credential. \n4. Client uploads files in multipart/form with credential.\n5. As soon as file is created on s3 bucket, lambda is triggered for image processing.\n6. Lambda calls api server for callback for success or failure.\n\nRefer to [sequence diagram](resources/sd.png) for more detail.\n\n## Requirements\nBecause this module supports native django json fields. (will support 2.X in the future)\n- Django 3.1 and up\n- Python 3.6 and up\n- DB: MariaDB 10.2.7+, MySQL 5.7.8+, Oracle, PostgreSQL, and SQLite\n\n## python packages\n- djangorestframework\n- drf-yasg\n- boto3\n\n\n# Instruction \n## Cloud module\nYou need to deploy cloud module(storage and serverless function) first. \nI provided [SAM template](https://github.com/kokospapa8/django-async-image-upload) to automate deployment. \nRefer to following page for detailed instruction.\n\n## Django API Module\n\nInstall Django-async-image-upload::\n\n    pip install django-async-image-upload\n\n\nAdd it to your INSTALLED_APPS::\n\n    INSTALLED_APPS = (\n\n        'django_async_image_upload.apps.AsyncImageUploadAppConfig',\n\n    )\n\n\nAdd Django-async-image-upload's URL patterns::\n\n    from django_async_image_upload import urls as django_async_image_upload_urls\n    \n    urlpatterns = [\n        url(r'^', include(django_async_image_upload_urls)),\n    ]\n    \n\n\n# Settings\nAvailable settings are:\n\n`ASYNC_IMAGE_UPLOAD_BUCKET` \n- name of bucket where presigned url is generated\n- default: None\n\n`ASYNC_IMAGE_UPLOAD_TEMPORARY_IMAGE_PATH`\n- folder path where image is uploaded using presigned url\n- default: \"temp/\" \n\n`ASYNC_IMAGE_UPLOAD_PRESIGNED_URL_EXPIRATION`\n- Presigned url expiration in second\n- default: 1000\n\n`ASYNC_IMAGE_UPLOAD_PRESIGNED_URL_REUSE_WINDOW`\n- Time in second where you can reuse already generated presigned url \n- default: 30\n\n`ASYNC_IMAGE_UPLOAD_PRESIGNED_URL_CONTENT_LENGTH`\n- Max size of image in byte\n- default: 10485760 # 10MiB\n\n`PROCESSED_IMAGE_MODEL` \n- Image model that will be created when success callback is issued.  \n- default: \"ProcessedImage\"\n\n`AWS_ACCESS_KEY_ID` and `AWS_ACCESS_KEY_SECRET`\n- Assuming you are already using Boto3, you need to set following AWS credentials\n\n\n\n## Create presigned url \nPOST to `/async_image/presignedurl/` to generate presignedurl credential.\n\n![post](resources/sample_response.png)\n\n### Swagger\nFor more information regarding api, you can access swagger on http://\u003chost\u003e/async_image/docs/swagger?format=openapi\n![swagger](resources/swagger.png)\n\n## Upload image file to bucket\nClient can use multipart/form upload to given url and fields in credential in with image file to upload to s3 bucket.\n\nOrder of the key matters, I recommend you to send in order of \"key, acl, x-amz-meta-id... file\".\n![postman](resources/postman.png)\n\n\n## How to check successful process from client \nBecause of the nature of the async operation, you won't be able to find out the result of the upload right after you upload to S3.\nYou have following options.\n\n1. Long polling - GET request to `/async_image/presignedurl/\u003cuuid\u003e` for completion. \n2. Open connection with sever using technics such as websocket, graphql.\n3. Assume operation is successful workaround it.\n\nIt's your choice. (There might be better solution out there. Please let me know if you have simpler solution.)\n\n\n## Extra note\nIf you are deploying on EC2, your EC2 should have appropriate IAM credential or EC2 role with `s3:putOject` permission on particular bucket.\n\n\n## Running Tests\nTBD\n\n\n## Credits\nTools used in rendering this package:\n\n*  [Cookiecutter](https://github.com/cookiecutter/cookiecutter)\n*  [cookiecutter-djangopackage](https://github.com/pydanny/cookiecutter-djangopackage)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokospapa8%2Fdjango-async-image-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkokospapa8%2Fdjango-async-image-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokospapa8%2Fdjango-async-image-upload/lists"}