https://github.com/ebertti/lesscache
Serverless cache backend for Django and Flask [WIP]
https://github.com/ebertti/lesscache
cache django dynamodb flask serverless
Last synced: 9 months ago
JSON representation
Serverless cache backend for Django and Flask [WIP]
- Host: GitHub
- URL: https://github.com/ebertti/lesscache
- Owner: ebertti
- Created: 2018-11-15T20:36:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T01:21:15.000Z (over 3 years ago)
- Last Synced: 2025-04-25T12:05:18.562Z (11 months ago)
- Topics: cache, django, dynamodb, flask, serverless
- Language: Python
- Homepage: https://pypi.org/project/lesscache
- Size: 157 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
LessCache
=========
Serverless cache backend for Django and Flask
Working with: AWS Dynamodb
.. image:: https://badges.gitter.im/Join%20Chat.svg
:alt: Join the chat at https://gitter.im/ebertti/lesscache
:target: https://gitter.im/ebertti/lesscache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. image:: https://img.shields.io/badge/django-1.11%202.0%202.1-brightgreen.svg
:target: http://pypi.python.org/pypi/lesscache
.. image:: https://img.shields.io/pypi/v/lesscache.svg?style=flat
:target: http://pypi.python.org/pypi/lesscache
.. image:: https://img.shields.io/pypi/pyversions/lesscache.svg?maxAge=2592000
:target: http://pypi.python.org/pypi/lesscache
.. image:: https://img.shields.io/pypi/format/lesscache.svg?maxAge=2592000
:target: http://pypi.python.org/pypi/lesscache
.. image:: https://img.shields.io/pypi/status/lesscache.svg?maxAge=2592000
:target: http://pypi.python.org/pypi/lesscache
.. image:: https://img.shields.io/travis/ebertti/lesscache/master.svg?maxAge=2592000
:target: https://travis-ci.org/ebertti/lesscache
.. image:: https://img.shields.io/requires/github/ebertti/lesscache.svg?maxAge=2592000
:target: https://requires.io/github/ebertti/lesscache/requirements/
.. image:: https://img.shields.io/coveralls/ebertti/lesscache/master.svg?maxAge=2592000
:target: https://coveralls.io/r/ebertti/lesscache?branch=master
.. image:: https://img.shields.io/codeclimate/github/ebertti/lesscache.svg
:target: https://codeclimate.com/github/ebertti/lesscache
Installation
------------
**pip**
``pip install lesscache``
**pipenv**
``pipenv install lesscache``
Setup on Django
---------------
On Django Settings
.. code-block:: python
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**