Metadata-Version: 2.1
Name: django-cache-with-mongodb
Version: 2021.7.8
Summary: Provides caching ability through MongoDB. Forked and detached from django_mongodb_cash_backend.
Home-page: https://github.com/Olivier-OH/django-cache-with-mongodb
Author: Olivier Hoareau
Author-email: olivier.p.hoareau@gmail.com
Maintainer: Olivier Hoareau
Maintainer-email: olivier.p.hoareau@gmail.com
License: BSD-3-Clause
Keywords: django,web,cache,mongodb
Platform: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Framework :: Django
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Provides: django_cache_with_mongodb
Description-Content-Type: text/markdown
Requires-Dist: pymongo (==3.*)

# Django Cache With MongoDB

## Installation and Usage

Install with:

    $ pip install django-cache-with-mongodb

Add the following to your Django settings::

    CACHES = {
        'default': {
            'BACKEND': 'django_cache_with_mongodb.MongoDBCache',
            "LOCATION": "hostname[:port]",
            "OPTIONS": {
                "USERNAME": "username_if_desired",
                "PASSWORD": "password_if_needed",
                "DATABASE": "cache_db_name",
                "COLLECTION": "cache_colleciton", # default: django_cache
            },
            "TIMEOUT": 86400, # either set TIMEOUT or MAX_ENTRIES, not both
            "MAX_ENTRIES": 10000, # either set MAX_ENTRIES or TIMEOUT, not both
        }
    }


## Notice

The backend will handle TTL index creation if TIMEOUT is set, or will create a capped collection if MAX_ENTRIES is set. You should ensure that the collections are not created beforehands, so that the backend can do its work correctly.


