{"id":27643768,"url":"https://github.com/xncbf/django-dynamodb-cache","last_synced_at":"2025-06-11T11:18:53.391Z","repository":{"id":41316031,"uuid":"458012547","full_name":"xncbf/django-dynamodb-cache","owner":"xncbf","description":"Django cache backend for serverless","archived":false,"fork":false,"pushed_at":"2024-01-28T12:32:24.000Z","size":73,"stargazers_count":32,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-06T00:14:42.406Z","etag":null,"topics":["aws","cache","django","python","serverless"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-dynamodb-cache/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xncbf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-11T02:00:21.000Z","updated_at":"2025-01-05T11:03:18.000Z","dependencies_parsed_at":"2024-11-14T12:58:00.692Z","dependency_job_id":"1bfbd4da-df03-4205-8c8e-5c63b11ef880","html_url":"https://github.com/xncbf/django-dynamodb-cache","commit_stats":{"total_commits":72,"total_committers":6,"mean_commits":12.0,"dds":0.4305555555555556,"last_synced_commit":"f7e07659965115a5dcad457c31a950480e77922f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xncbf%2Fdjango-dynamodb-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xncbf%2Fdjango-dynamodb-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xncbf%2Fdjango-dynamodb-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xncbf%2Fdjango-dynamodb-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xncbf","download_url":"https://codeload.github.com/xncbf/django-dynamodb-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xncbf%2Fdjango-dynamodb-cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259253417,"owners_count":22829143,"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":["aws","cache","django","python","serverless"],"created_at":"2025-04-24T00:17:57.713Z","updated_at":"2025-06-11T11:18:53.324Z","avatar_url":"https://github.com/xncbf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-dynamodb-cache\n\nFast, safe, cost-effective DynamoDB cache backend for Django\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/xncbf/django-dynamodb-cache/actions/workflows/tests.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/xncbf/django-dynamodb-cache/actions/workflows/tests.yml/badge.svg\" alt=\"Tests\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/xncbf/django-dynamodb-cache\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/xncbf/django-dynamodb-cache?color=%2334D058\" alt=\"Coverage\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/django-dynamodb-cache\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/django-dynamodb-cache?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/django-dynamodb-cache\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/django-dynamodb-cache.svg?color=%2334D058\" alt=\"Supported Python versions\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/django-dynamodb-cache\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/djversions/django-dynamodb-cache.svg\" alt=\"Supported django versions\"\u003e\n\u003c/a\u003e\n\u003ca href=\"http://pypi.python.org/pypi/django-dynamodb-cache/blob/main/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/xncbf/django-dynamodb-cache?color=gr\" alt=\"License\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n- [django-dynamodb-cache](#django-dynamodb-cache)\n  - [Introduce](#introduce)\n  - [Why should I use this?](#why-should-i-use-this)\n  - [Installation](#installation)\n  - [Setup on Django](#setup-on-django)\n  - [Aws credentials](#aws-credentials)\n  - [Create cache table command](#create-cache-table-command)\n  - [Future improvements](#future-improvements)\n  - [How to contribute](#how-to-contribute)\n    - [Debug](#debug)\n\n## Introduce\n\nThis project is a cache backend using aws dynamodb.\n\nThis is compatible with the django official cache framework.\n\nDid you set the boto3 permission?\n\nEnter the django official command createcachetable and get started easily.\n\n## Why should I use this?\n\n- There are few management points, because dynamodb is a fully managed service.\n- Because you only pay for what you use, it saves money on light projects such as side projects or back offices.\n- If you need more performance, you can easily switch to DAX.\n\n## Installation\n\n```sh\npip install django-dynamodb-cache\n```\n\n## Setup on Django\n\nOn Django `settings.py`\n\n```python\n\n\nINSTALLED_APPS = [\n    ...\n    \"django_dynamodb_cache\"\n]\n\nCACHES = {\n    \"default\": {\n        \"BACKEND\": \"django_dynamodb_cache.backend.DjangoCacheBackend\",\n        \"LOCATION\": \"table-name\",                  # (mandatory)\n        \"TIMEOUT\": 300,                            # (optional) seconds\n        \"KEY_PREFIX\": \"django_dynamodb_cache\",     # (optional)\n        \"VERSION\": 1,                              # (optional)\n        \"KEY_FUNCTION\": \"path.to.function\",        # (optional) f\"{prefix}:{key}:{version}\"\n        \"OPTIONS\": {\n            \"aws_region_name\": \"us-east-1\",                    # (optional)\n            \"aws_access_key_id\": \"aws_access_key_id\",          # (optional)\n            \"aws_secret_access_key\": \"aws_secret_access_key\",  # (optional)\n            \"is_on_demand\": False,                 # (optional) default: True\n            \"read_capacity_units\": 1,              # (optional)\n            \"write_capacity_units\": 1,             # (optional)\n            \"encode\": \"django_dynamodb_cache.encode.PickleEncode\"  # (optional)\n        }\n    }\n}\n```\n\n## Aws credentials\n\nThe same method as configuring-credentials provided in the boto3 documentation is used.\n\u003chttps://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials\u003e\n\n## Create cache table command\n\nRun manage command to create cache table on Dynamodb before using\n\n```zsh\npython manage.py createcachetable\n```\n\n## Future improvements\n\nIn this project, the following can be improved in the future.\n\n- A full scan is included to achieve `cache.clear()`.\nThis can lead to performance degradation when there is a lot of cached data.\n\n\n## How to contribute\n\nThis project is welcome to contributions!\n\nPlease submit an issue ticket before submitting a patch.\n\nPull requests are merged into the main branch and should always remain available.\n\nAfter passing all test code, it is reviewed and merged.\n\n### Debug\n\nTests must be run in a sandbox environment.\n\nTo run the Dynamodb sandbox:\n```\ndocker compose up --build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxncbf%2Fdjango-dynamodb-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxncbf%2Fdjango-dynamodb-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxncbf%2Fdjango-dynamodb-cache/lists"}