# 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": "[mongodb://][username:password@]host1[:port1][,...hostN[:portN]][/[defaultdb][?options]]",
"OPTIONS": {
"USERNAME": "username_if_desired",
"PASSWORD": "password_if_needed",
"DATABASE": "cache_db_name", # in not supplied in URI
"COLLECTION": "cache_collection", # default: django_cache
# Any Connection Options supported by pymongo
},
"TIMEOUT": 86400, # either set TIMEOUT or MAX_ENTRIES, not both
"MAX_ENTRIES": 10000, # either set MAX_ENTRIES or TIMEOUT, not both
}
}
### LOCATION
Location supports MongoDB [Connection String](https://www.mongodb.com/docs/manual/reference/connection-string/). Additionally, any supported pymongo parameters could be
### OPTIONS
Any supported [pymongo parameters](https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html) could be added to OPTIONS.
## 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/Olivier-OH/django-cache-with-mongodb",
"name": "django-cache-with-mongodb",
"maintainer": "Olivier Hoareau",
"docs_url": null,
"requires_python": null,
"maintainer_email": "olivier.p.hoareau@gmail.com",
"keywords": "django, web, cache, mongodb",
"author": "Olivier Hoareau",
"author_email": "olivier.p.hoareau@gmail.com",
"download_url": null,
"platform": "OS Independent",
"description": "# Django Cache With MongoDB\r\n\r\n## Installation and Usage\r\n\r\nInstall with:\r\n\r\n $ pip install django-cache-with-mongodb\r\n\r\nAdd the following to your Django settings::\r\n\r\n CACHES = {\r\n 'default': {\r\n 'BACKEND': 'django_cache_with_mongodb.MongoDBCache',\r\n \"LOCATION\": \"[mongodb://][username:password@]host1[:port1][,...hostN[:portN]][/[defaultdb][?options]]\",\r\n \"OPTIONS\": {\r\n \"USERNAME\": \"username_if_desired\",\r\n \"PASSWORD\": \"password_if_needed\",\r\n \"DATABASE\": \"cache_db_name\", # in not supplied in URI\r\n \"COLLECTION\": \"cache_collection\", # default: django_cache\r\n # Any Connection Options supported by pymongo\r\n },\r\n \"TIMEOUT\": 86400, # either set TIMEOUT or MAX_ENTRIES, not both\r\n \"MAX_ENTRIES\": 10000, # either set MAX_ENTRIES or TIMEOUT, not both\r\n }\r\n }\r\n\r\n### LOCATION\r\n\r\nLocation supports MongoDB [Connection String](https://www.mongodb.com/docs/manual/reference/connection-string/). Additionally, any supported pymongo parameters could be \r\n\r\n### OPTIONS\r\n\r\nAny supported [pymongo parameters](https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html) could be added to OPTIONS.\r\n\r\n## Notice\r\n\r\nThe 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.\r\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Provides caching ability through MongoDB. Forked and detached from django_mongodb_cash_backend.",
"version": "2024.11.27",
"project_urls": {
"Homepage": "https://github.com/Olivier-OH/django-cache-with-mongodb"
},
"split_keywords": [
"django",
" web",
" cache",
" mongodb"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "01004a229838668ac1067353b0d5e8216440e573ef7f36e467a38b8b2332fc3e",
"md5": "b92a34d160ef1539ebbe665b206eb709",
"sha256": "ca6d96e1fc7adc70941ae99d935445ceac79ed29c741d7d0aa61f55baa49b410"
},
"downloads": -1,
"filename": "django_cache_with_mongodb-2024.11.27-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b92a34d160ef1539ebbe665b206eb709",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7426,
"upload_time": "2024-12-12T12:48:28",
"upload_time_iso_8601": "2024-12-12T12:48:28.144247Z",
"url": "https://files.pythonhosted.org/packages/01/00/4a229838668ac1067353b0d5e8216440e573ef7f36e467a38b8b2332fc3e/django_cache_with_mongodb-2024.11.27-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 12:48:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Olivier-OH",
"github_project": "django-cache-with-mongodb",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pymongo",
"specs": [
[
">=",
"4.0.2"
]
]
}
],
"lcname": "django-cache-with-mongodb"
}