Skip to content
Serverless cache backend for Django and Flask [WIP]
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lesscache
tests
.coveragerc
.editorconfig
.gitignore
.landscape.yaml
.travis.yml
Pipfile
Pipfile.lock
README.rst
manage.py
pytest.ini
setup.py
tox.ini

README.rst

LessCache

Serverless cache backend for Django and Flask

Working with: AWS Dynamodb

Join the chat at https://gitter.im/ebertti/lesscache https://img.shields.io/pypi/v/lesscache.svg?style=flat https://img.shields.io/pypi/pyversions/lesscache.svg?maxAge=2592000 https://img.shields.io/pypi/format/lesscache.svg?maxAge=2592000 https://img.shields.io/pypi/status/lesscache.svg?maxAge=2592000 https://img.shields.io/travis/ebertti/lesscache/master.svg?maxAge=2592000 https://img.shields.io/requires/github/ebertti/lesscache.svg?maxAge=2592000 https://img.shields.io/coveralls/ebertti/lesscache/master.svg?maxAge=2592000

Installation

pip

pip install lesscache

pipenv

pipenv install lesscache

Setup on Django

On Django Settings

instaled_apps = [
    ...
    'lesscache.compact.django'
]

CACHES = {
    'default': {
        'BACKEND': 'lesscache.compact.django.cache.DjangoCacheDynamodb',
        'TIMEOUT': 120  # default 120 seconds == 2minutes
        'KEY_PREFIX': 'less'  # default less
        'VERSION': 1  # default 1
        'KEY_FUNCTION': 'path.to.function' # f'{prefix}:{key}:{version}'

        'OPTIONS': {
            'aws_access_key_id': None       # need only if you dont have login
            'aws_secret_access_key': None   # on aws-cli with your key
            'aws_region_name': None         # or not in aws lambda

            'read_capacity_units': 1
            'write_capacity_units': 1
            'encode': 'path.to.encode'  # default: 'lesscache.encode.PickleEncode
        }
    }
}

Run manage command to create cache table on Dynamodb before using

python manage.py create_dynamodb_cache

Setup on Flask

WIP

How to contribute

WIP

You can’t perform that action at this time.