Skip to main content

No project description provided

Project description

django-dynamodb-cache

Fast, safe, cost-effective DynamoDB cache backend for Django

Tests Coverage Package version Supported Python versions Supported django versions License

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",  # default: django-dynamodb-cache
        "TIMEOUT": 120,  # seconds
        "KEY_PREFIX": "django_dynamodb_cache",
        "VERSION": 1,
        "KEY_FUNCTION": "path.to.function",  # 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 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-dynamodb-cache-0.2.0.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

django_dynamodb_cache-0.2.0-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page