Skip to content

Commit

Permalink
update: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xncbf committed Mar 22, 2022
1 parent eacef14 commit 8831e20
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@ Fast, safe, cost-effective DynamoDB cache backend for Django
</p>

- [django-dynamodb-cache](#django-dynamodb-cache)
- [Introduce](#introduce)
- [Installation](#installation)
- [Setup on Django](#setup-on-django)
- [Aws credentials](#aws-credentials)
- [Create cache table command](#create-cache-table-command)
- [How to contribute](#how-to-contribute)

## Introduce

This project is a cache backend using aws dynamodb.

This is compatible with the django official cache framework.

Did you set the boto3 permission?

Enter the django official command createcachetable and get started easily

## Installation

```sh
Expand All @@ -51,16 +62,18 @@ INSTALLED_APPS = [
CACHES = {
"default": {
"BACKEND": "django_dynamodb_cache.backend.DjangoCacheBackend",
"LOCATION": "table-name", # default: django-dynamodb-cache
"TIMEOUT": 120, # seconds
"KEY_PREFIX": "django_dynamodb_cache",
"VERSION": 1,
"KEY_FUNCTION": "path.to.function", # f"{prefix}:{key}:{version}"
"LOCATION": "table-name", # (mandatory)
"TIMEOUT": 120, # (optional) seconds
"KEY_PREFIX": "django_dynamodb_cache", # (optional)
"VERSION": 1, # (optional)
"KEY_FUNCTION": "path.to.function", # (optional) f"{prefix}:{key}:{version}"
"OPTIONS": {
"aws_region_name": "us-east-1",
"read_capacity_units": 1,
"write_capacity_units": 1,
"encode": "django_dynamodb_cache.encode.PickleEncode"
"aws_region_name": "us-east-1", # (optional)
"aws_access_key_id": "us-east-1", # (optional)
"aws_secret_access_key": "us-east-1", # (optional)
"read_capacity_units": 1, # (optional)
"write_capacity_units": 1, # (optional)
"encode": "django_dynamodb_cache.encode.PickleEncode" # (optional)
}
}
}
Expand Down

0 comments on commit 8831e20

Please sign in to comment.