No project description provided
Project description
django-dynamodb-cache
Fast, safe, cost-effective DynamoDB cache backend for Django
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
pip install django-dynamodb-cache
Setup on Django
On Django settings.py
INSTALLED_APPS = [
...
"django_dynamodb_cache"
]
CACHES = {
"default": {
"BACKEND": "django_dynamodb_cache.backend.DjangoCacheBackend",
"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", # (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)
}
}
}
Aws credentials
The same method as configuring-credentials provided in the boto3 documentation is used. https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html#configuring-credentials
Create cache table command
Run manage command to create cache table on Dynamodb before using
python manage.py createcachetable
How to contribute
This project is welcome to contributions!
Please submit an issue ticket before submitting a patch.
Pull requests are merged into the main branch and should always remain available.
After passing all test code, it is reviewed and merged.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-dynamodb-cache-0.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b697aee47dc81e06df8e86c45ad88c25aec234a0d5d4c602383157b0e943dc6b |
|
MD5 | 3427b4062afeff7aa73f344f39ce8d9e |
|
BLAKE2b-256 | fe916667656339de34ebcd9ca5ca702181b864ef5754a87d5cbb801c0ae319a7 |
Hashes for django_dynamodb_cache-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b826161f6813209d474f3633e105faa4e83ca740aaba2ea18efd4ae791113a3 |
|
MD5 | 7e02a71da6277eae9f57faf68285cd4b |
|
BLAKE2b-256 | ba0ff9d3a5cfd1c353c254b3d6ae3e2c964a740e72b982a8d950beb0eae5452b |