{"id":21532403,"url":"https://github.com/wiktorboro/drf-image-upload","last_synced_at":"2025-06-30T19:35:14.143Z","repository":{"id":52524046,"uuid":"517088138","full_name":"WiktorBoro/drf-image-upload","owner":"WiktorBoro","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-01T21:24:07.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T11:13:49.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WiktorBoro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-23T15:02:59.000Z","updated_at":"2022-08-01T17:28:08.000Z","dependencies_parsed_at":"2022-09-19T00:30:26.639Z","dependency_job_id":null,"html_url":"https://github.com/WiktorBoro/drf-image-upload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WiktorBoro/drf-image-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf-image-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf-image-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf-image-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf-image-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WiktorBoro","download_url":"https://codeload.github.com/WiktorBoro/drf-image-upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WiktorBoro%2Fdrf-image-upload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262839193,"owners_count":23372674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-24T02:19:49.712Z","updated_at":"2025-06-30T19:35:14.122Z","avatar_url":"https://github.com/WiktorBoro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image upload based on django\n\n# API capabilities\n- Create Account Tier with the given parameters \n- Create Users with given account tier\n- Get users list\n- Get account tiers list\n- Upload image for the user\n- Get a list of photos and sizes (available for the account level) for, a given user\n- Generate expiring binary image (if your account level allows it)\n\n# Heroku deploy\n\nhttps://image-upload2.herokuapp.com\n\n# Quickstart\n\n## Clone repository\n`git clone https://github.com/WiktorBoro/rock-paper-scissors.git`\n\n## Install the libraries\n`pip install -r requirements.txt`\n\n## Create superuser to access the database \n`python manage.py createsuperuser`\n\nfill in the required fields\n\n## Go to manage.py location\nRun\n\n`python manage.py runserver`\n\n### Start celery worker \n\nfor windows\n\n`celery -A image_upload worker -l info --pool=solo`\n\nand for macs\n\n`celery -A image_upload worker -l info`\n\n## Go to your local host \nhttp://127.0.0.1:8000/\n\n## Admin site\nhttp://127.0.0.1:8000/admin\n\n# Endpoints\n\n## 1. Users\n\nUrl: `/users`\n\n### Method: GET\n\nObtains a list of all existing users.\n\nReturn a list of dictionary with all users with their account levels\n\nReturn example: \n```\n[\n    {\n        \"user_name\":\"\u003cstr: user name\u003e\", \n        \"account_tier\": \"\u003cstr: account tier name\u003e\"\n    }, \n....\n]`\n```\n### Method: POST\n\nCreate new user\n\nBody: \n```\n{\n    \"user_name\": \"\u003cstr: user name\u003e\", \n    \"account_tier\": \"\u003cstr: account tier name\u003e\"\n}\n```\nReturn dictionary with user_name and account tier key\n\nReturn example:\n```\n{\n    \"user_name\": \"Test\", \n    \"account_tier\": \"Basic\"\n}\n```\n\n### Method: GET\nGet a list of photos and sizes (available for the account level) for, a given user\n\nUrl: `/users/\u003cstr: user-name\u003e`\n\nReturn dictionary of dictionaries with the size of the images and a links to them\n\nReturn example: \n```\n[\n    {\n        \"image_name\": \"\u003cstr: image name\u003e\",\n        \"width\": \u003cint: original image width\u003e,\n        \"height\": \u003cint: original image height\u003e,\n        \"link\": \u003cstr: link to original image OPTIONAL if the account permissions are appropriate\u003e,\n        \"resize_images_list\": [\n            {\n                \"width\": \u003cint: resize image width\u003e,,\n                \"height\": \u003cint: resize image height\u003e,\n                \"resize_image\": \"\u003cstr: resize image link\u003e\"\n            },\n            ....\n        ]\n    },\n    ....\n]\n```\n\n## 2. Account tiers\n\nUrl: `/account-tiers`\n\n### Method: GET\n\nObtains a list of all existing account tiers with permissions and available image sizes.\n\nReturn a list of dictionary with all account tiers with permissions and available image\n\nReturn example: \n```\n[\n    {\n        \"account_tier_name\": \"\u003cstr: account tier name\u003e\",\n        \"link_to_the_originally_uploaded_file\": \u003cboolean\u003e,\n        \"ability_to_generate_expiring_links\": \u003cboolean\u003e,\n        \"image_height\": \"\u003cstr: list in string with available image sizes\u003e\"\n    },\n    ....\n]\n```\n\n### Method: GET\n\nUrl: `/account-tiers/\u003cstr: accoun tier name\u003e`\n\nReturns the data of one level of the account\n\nReturn example: \n```\n{\n        \"account_tier_name\": \"\u003cstr: account tier name\u003e\",\n        \"link_to_the_originally_uploaded_file\": \u003cboolean\u003e,\n        \"ability_to_generate_expiring_links\": \u003cboolean\u003e,\n        \"image_height\": \"\u003cstr: list in string with available image sizes\u003e\"\n    }\n```\n\n## 3. Image upload\n\nUrl: `/image-upload`\n\n### Method: POST\nSend a photo and give it a name for the chosen user\n\nBody: \n```\n{\n    \"user\": \"\u003cstr: user name\u003e\", \n    \"image_name\": \"\u003cstr: name the image\u003e\", \n    \"image\": \u003cobject: image file\u003e\n}\n```\n\nReturn example: \n```\n{\n    \"image_name\": \"\u003cstr: image name\u003e\",\n    \"link\": \u003cstr: link to original image OPTIONAL if the account permissions are appropriate\u003e,\n    \"resize_images_list\": [\n            {\n                \"width\": \u003cint: resize image width\u003e,,\n                \"height\": \u003cint: resize image height\u003e,\n                \"resize_image\": \"\u003cstr: resize image link\u003e\"\n            },\n            ....\n    ]\n}\n```\n\n## 3. Generate expiring binary image\n\nUrl: `/expires-image`\n\n### Method: POST\n\nSpecify the username, image name, and the expiration time, if you have sufficient account tier, the graphic will be generated which will expire after the specified time.\n\n!Note the graphic must belong to the specified user\n\nBody: \n```\n{   \n    \"user\": \"\u003cstr: user name\u003e\", \n    \"original_image\": \"\u003cstr: original image name\u003e\", \n    \"image\": \u003cobject: image file\u003e\n}\n```\n\nReturn example: \n```\n{\n    \"expiring_time\": \u003cint: expiring time\u003e,\n    \"resize_image\": \"\u003cstr: link\u003e\"\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiktorboro%2Fdrf-image-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiktorboro%2Fdrf-image-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiktorboro%2Fdrf-image-upload/lists"}