{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# django-memcached-consul\n\nDjango-memcached-consul helps use consul for memcached servers.\nIt will query Consul Health API to get list of servers every time we use the cache.\n\n## Usage\n\nThe configuration is done in the cache part of local_settings.py in the Django project.\nDjango-memcached-consul use the Django memcached driver so all configuration related to the\ncaching itself should be done like in django memcached.\n\nTo use consul you need to use the specific Django-memcached-consul driver:\n`django-consul-memcached.memcached.MemcachedCache`\n\nAnd to provide informations about Consul and the required services:\n```\nCONSUL_HOST # The Consul API host\nCONSUL_PORT # The Consul API port\nCONSUL_SERVICE # The service of the memcached servers in Consul\n```\nIt is possible and strongly recommended to use a cache for the consul, otherwise an Consul API call\nwill be issued every time we use the cache.\n\nDjango-memcached-consul use two layer of cache: the first layer should be short lived (`CONSUL_TTL`)\nand is used to cache the list of memcached servers and is retrieved everytime we use the\ndjango-consul-memcached driver. The second one is long lived (`CONSUL_TTL_ALT`) and retrieved when\nConsul API is unreachable. The name of the cache to be used is set in `CONSUL_CACHE` and the cache\nshould be preferably a filebased cache to be shared accross all workers.\n\n## Example\n\n```\nCACHES = {\n 'default': {\n 'BACKEND': 'django_memcached_consul.memcached.MemcachedCache',\n 'TIMEOUT': 60,\n 'CONSUL_TTL': 60,\n # Alt cache will be used if consul is unreachable\n 'CONSUL_ALT_TTL': 3600,\n 'CONSUL_CACHE': 'consul-memcached',\n 'CONSUL_HOST': 'consul.organization.com',\n 'CONSUL_PORT': 8500,\n 'CONSUL_SERVICE': 'memcached-service',\n },\n 'consul-memcached': {\n 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',\n 'LOCATION': '/var/tmp/django_consul_cache',\n }\n}\n```\n\n## Testing\n\nTesting require memcached and tox.\n\nFirst you need to run memcached on default configuration (usually at localhost:11211) or you will\nhave to change informations in `tests/tests_data/consul_api_health_mock_with_memcached.json`).\n\nThen you can run tox at the root of the project to start the tests:\n```\ntox\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/criteo/django-memcached-consul", "keywords": "django memcached consul", "license": "Apache Software License", "maintainer": "Criteo", "maintainer_email": "github@criteo.com", "name": "django-memcached-consul", "package_url": "https://pypi.org/project/django-memcached-consul/", "platform": "", "project_url": "https://pypi.org/project/django-memcached-consul/", "project_urls": { "Homepage": "https://github.com/criteo/django-memcached-consul" }, "release_url": "https://pypi.org/project/django-memcached-consul/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Django module that use consul to generate the list of memcached servers", "version": "0.1.3" }, "last_serial": 5836005, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d4bcbdea99ccb91566d9e80d28b692bc", "sha256": "d2f28a7bb7ac6eaac5d904d6a33bc80af3cdc1582224830518fcfddcf0f73ab3" }, "downloads": -1, "filename": "django_memcached_consul-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d4bcbdea99ccb91566d9e80d28b692bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4375, "upload_time": "2018-03-29T08:48:37", "url": "https://files.pythonhosted.org/packages/0a/04/dcdd97ff207cc3805670c9790982d1666ce011b2f9a9d1e10ba37321848c/django_memcached_consul-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1fd22cb01f430ba1dcf66e54a95ed4d6", "sha256": "5953ca9ead714fd348537018d06afbf9046cb0f6bace03fa8644dfeaa8bf6d3f" }, "downloads": -1, "filename": "django_memcached_consul-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1fd22cb01f430ba1dcf66e54a95ed4d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4385, "upload_time": "2018-06-20T15:35:41", "url": "https://files.pythonhosted.org/packages/e7/04/31e1bbb11d50404f48cda7346ec35503e88cc4b53b4ff86dda5ab9451518/django_memcached_consul-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "91f3d1e15a44db1d400cc55d43a4ecdf", "sha256": "279fbdbb81237f9d380eb5ca72e8478abf5c4f4c65798aeab5d66201e2f4ecd8" }, "downloads": -1, "filename": "django_memcached_consul-0.1.2.tar.gz", "has_sig": false, "md5_digest": "91f3d1e15a44db1d400cc55d43a4ecdf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4405, "upload_time": "2019-05-24T09:21:54", "url": "https://files.pythonhosted.org/packages/af/c9/2cb9f6a01607ec1932a466b8873b22993953510ac4ef12c1dbc41fa446a6/django_memcached_consul-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "60d0b3c5f6bc20f9b18b78cf8d3131df", "sha256": "41e74652d50cc97e7b73b0a5a7babc185e168c2c0d374392cd66a607bdc56fba" }, "downloads": -1, "filename": "django_memcached_consul-0.1.3.tar.gz", "has_sig": false, "md5_digest": "60d0b3c5f6bc20f9b18b78cf8d3131df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4415, "upload_time": "2019-05-27T08:48:33", "url": "https://files.pythonhosted.org/packages/c9/11/b9df39fef24687b45e4c7ffad07d960ba392cdc3957e477ac30183d3ddc9/django_memcached_consul-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "60d0b3c5f6bc20f9b18b78cf8d3131df", "sha256": "41e74652d50cc97e7b73b0a5a7babc185e168c2c0d374392cd66a607bdc56fba" }, "downloads": -1, "filename": "django_memcached_consul-0.1.3.tar.gz", "has_sig": false, "md5_digest": "60d0b3c5f6bc20f9b18b78cf8d3131df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4415, "upload_time": "2019-05-27T08:48:33", "url": "https://files.pythonhosted.org/packages/c9/11/b9df39fef24687b45e4c7ffad07d960ba392cdc3957e477ac30183d3ddc9/django_memcached_consul-0.1.3.tar.gz" } ] }