Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
e5faa12
replace pylibc to pymemcache
Apr 10, 2017
532d28a
add ignore_exc parameter
Apr 10, 2017
2ecc21c
rename module name
Apr 11, 2017
e1f0ba1
rename readme
Apr 11, 2017
bea9225
add options
Apr 11, 2017
8c3c15a
fix README path
Apr 11, 2017
cc8e30e
rm png
Apr 11, 2017
64ec2a1
memo self._client
Apr 11, 2017
e90da03
rm options from example
Apr 11, 2017
0dd0160
rm print
Apr 11, 2017
f630816
Update LICENSE
opapy Apr 11, 2017
9edd161
fix README
Apr 11, 2017
0715186
fix markdown
Apr 11, 2017
6255a8b
fix manifest.in
Apr 11, 2017
eabbfc1
Merge pull request #1 from uncovertruth/feature/pymemcache
Surgo Apr 11, 2017
027b83d
Re-generate via gibo
Surgo Apr 11, 2017
aab80f7
Set up Travis-CI
Surgo Apr 11, 2017
abb81fe
Remove support for Django 1.7
Surgo Apr 11, 2017
4263c21
Merge pull request #2 from uncovertruth/feature/enable_ci
opapy Apr 11, 2017
4c90b99
Add dependencies for test
Surgo Apr 11, 2017
99d800d
Update setup.py - fix license etc.
Surgo Apr 11, 2017
0be478d
Fix flake8 bugs
Surgo Apr 11, 2017
e419a90
Fix flake8, check-manifest and isort bugs
Surgo Apr 11, 2017
4d2685d
Use rest format
Surgo Apr 11, 2017
cb60e0a
Add codecov badge
Surgo Apr 11, 2017
156630c
Enable include_trailing_comma option
Surgo Apr 11, 2017
242b83c
Test only project files
Surgo Apr 11, 2017
f314e6c
Fix wrong commands
Surgo Apr 11, 2017
87764a3
Fix rest format
Surgo Apr 11, 2017
9546134
Merge pull request #3 from uncovertruth/fix/ci_passed
opapy Apr 11, 2017
eb00cfe
Add deployment for pypi
Surgo Apr 12, 2017
3f95c37
Add pypi badge
Surgo Apr 12, 2017
8d1df6f
Merge pull request #4 from uncovertruth/feature/release_pypi
opapy Apr 12, 2017
dc9a1d2
Deploy only specific env
Surgo Apr 12, 2017
2268a33
Merge pull request #5 from uncovertruth/fix/deploy
heavenshell Apr 12, 2017
c68373a
Fix wrong env name
Surgo Apr 12, 2017
4f04a7f
Fix wrong requirements file path
Surgo Apr 12, 2017
651d1bd
Run only specific env
Surgo Apr 12, 2017
7cb7c50
Fix wrong type
Surgo Apr 12, 2017
a7cd620
Apply patch for django<1.11
Surgo Apr 12, 2017
feda455
Codecov in specific version
Surgo Apr 12, 2017
ea29cce
Merge pull request #6 from uncovertruth/fix/env_name
opapy Apr 12, 2017
f01f28b
Fix typo
Surgo Apr 12, 2017
6fb2ba4
Skip upload docs
Surgo Apr 12, 2017
1e19168
Add tox env for pypy pypy3
Surgo Apr 12, 2017
4976e94
Bump version
Surgo Apr 12, 2017
76e71d1
Set codecov token
Surgo Apr 12, 2017
42e0ecc
Allow failure pypy3
Surgo Apr 12, 2017
2dbb39f
Fix worng env
Surgo Apr 12, 2017
d25f3ce
Merge pull request #7 from uncovertruth/fix/typo
opapy Apr 12, 2017
562fbfc
ignore error when get cluster info
Apr 12, 2017
7db72bd
set empty server when get cluster info
Apr 12, 2017
e095476
add timeout params
Apr 12, 2017
33d8dbe
edit README
Apr 12, 2017
0d89752
fix test
Apr 13, 2017
12b2276
set socket._GLOBAL_DEFAULT_TIMEOUT as default value for telnet
Apr 13, 2017
f4e8c7c
fix pep8
Apr 13, 2017
9e199ba
Merge pull request #8 from uncovertruth/feature/ignore_cluster_info_e…
Surgo Apr 13, 2017
2e397b9
bump version
Apr 13, 2017
13a6125
Merge pull request #9 from uncovertruth/feature/0.0.3
Surgo Apr 17, 2017
87ee7c4
add close method
May 10, 2017
2ca478a
replace serializer
May 10, 2017
08e38f6
fix test
May 10, 2017
45158a1
fix test
May 10, 2017
306ccfd
Merge pull request #10 from uncovertruth/bug/disconnect_all
Surgo May 10, 2017
e986e4a
bump version
May 11, 2017
0bcfa72
Merge pull request #11 from uncovertruth/feature/0.0.5
Surgo May 11, 2017
7fee4da
add ignore_cluster_errors params
May 15, 2017
bca3fa6
fix test
May 15, 2017
ebd2a61
fix flake8
May 15, 2017
f0899a0
Merge pull request #12 from uncovertruth/feature/ignore_cluster_errors
Surgo May 15, 2017
665651c
bump version
May 15, 2017
febe5f4
Merge pull request #13 from uncovertruth/feature/0.0.6
Surgo May 15, 2017
2b3b10d
Pin check-manifest to latest version 0.35
pyup-bot Jun 15, 2017
319f580
Pin coverage to latest version 4.4.1
pyup-bot Jun 15, 2017
2fb3be6
Pin flake8 to latest version 3.3.0
pyup-bot Jun 15, 2017
6b047d3
Pin isort to latest version 4.2.15
pyup-bot Jun 15, 2017
843df58
Pin mock to latest version 2.0.0
pyup-bot Jun 15, 2017
36070e9
Pin nose to latest version 1.3.7
pyup-bot Jun 15, 2017
dd802c4
Pin pymemcache to latest version 1.4.3
pyup-bot Jun 15, 2017
dd29490
Pin readme-renderer to latest version 17.2
pyup-bot Jun 15, 2017
0ff5328
Merge pull request #14 from uncovertruth/pyup-initial-update
Surgo Jun 15, 2017
844b190
Update flake8 from 3.3.0 to 3.4.1 (#16)
pyup-bot Jul 31, 2017
39f09c4
Update flake8 from 3.4.1 to 3.5.0 (#17)
pyup-bot Oct 24, 2017
439b467
Fix ignore pymemcache's get_many returns False value
heavenshell Nov 1, 2017
e966ddd
Fix get value more safe
heavenshell Nov 1, 2017
f12c7bb
Fix nested with statement to flatten
heavenshell Nov 1, 2017
275eaca
Merge pull request #19 from uncovertruth/fix/get_many
Surgo Nov 1, 2017
35e4d52
Release 1.0.0
heavenshell Nov 1, 2017
7b720f6
Merge pull request #20 from uncovertruth/feature/1.0.0
Surgo Nov 1, 2017
e9dcbfa
Update coverage from 4.4.1 to 4.4.2 (#21)
pyup-bot Nov 6, 2017
b22a694
Update check-manifest from 0.35 to 0.36 (#22)
pyup-bot Nov 22, 2017
8cded73
Update pymemcache from 1.4.3 to 1.4.4 (#23)
pyup-bot Jan 24, 2018
b333296
Update support versions (#25)
Surgo Feb 2, 2018
39d521d
Update isort from 4.2.15 to 4.3.0 (#26)
pyup-bot Feb 2, 2018
78d41f6
Update isort from 4.3.0 to 4.3.1 (#27)
pyup-bot Feb 3, 2018
10619ae
Update coverage from 4.4.2 to 4.5 (#28)
pyup-bot Feb 5, 2018
9846160
Update isort from 4.3.1 to 4.3.2 (#29)
pyup-bot Feb 5, 2018
9fad337
Update isort from 4.3.2 to 4.3.3 (#30)
pyup-bot Feb 6, 2018
1c1acbe
refacotor(travis) skip email
Feb 7, 2018
df7c05b
Merge pull request #31 from uncovertruth/fix/email
tsuyukimakoto Feb 7, 2018
99d610f
Update coverage from 4.5 to 4.5.1 (#32)
pyup-bot Feb 12, 2018
1f2bd00
Update isort from 4.3.3 to 4.3.4 (#33)
pyup-bot Feb 13, 2018
c56c5bb
Update readme-renderer from 17.2 to 17.3 (#34)
pyup-bot Mar 12, 2018
54a8c1f
Update readme-renderer from 17.3 to 17.4 (#35)
pyup-bot Mar 28, 2018
a9dc6af
Update readme-renderer from 17.4 to 18.1
pyup-bot Apr 1, 2018
49c4808
Merge pull request #37 from uncovertruth/pyup-update-readme-renderer-…
Surgo Apr 4, 2018
8560bb9
Update check-manifest from 0.36 to 0.37
pyup-bot Apr 12, 2018
d3fab33
Merge pull request #40 from uncovertruth/pyup-update-check-manifest-0…
heavenshell May 30, 2018
513309a
Update readme-renderer from 18.1 to 21.0 (#42)
pyup-bot May 30, 2018
d57eaba
Drop old django version
Jun 19, 2018
6c85ff9
Drop py34 in djdev case.
hirokinko Jun 20, 2018
6a4fe08
Remove unnecessary patches.
hirokinko Jun 20, 2018
e2ca6f9
Merge pull request #43 from uncovertruth/feature/drop_old_django_version
Surgo Jun 20, 2018
f859a22
update pymemcache=2.0.0
opapy Oct 9, 2018
3789543
Merge pull request #46 from uncovertruth/feature/pymemcache-2.0.0
Surgo Oct 9, 2018
7331871
update to 1.2.0
opapy Oct 9, 2018
3c00de0
Merge pull request #47 from uncovertruth/feature/1.2.0
Surgo Oct 9, 2018
cb20722
Update flake8 from 3.5.0 to 3.6.0
pyup-bot Oct 25, 2018
f9e6eda
Update readme-renderer from 21.0 to 24.0
pyup-bot Oct 28, 2018
c5a890c
fix super method params
opapy Nov 6, 2018
6b17307
Merge pull request #51 from uncovertruth/bug/remove-patch-set_many
Surgo Nov 6, 2018
22ef61f
Merge pull request #50 from uncovertruth/pyup-update-readme-renderer-…
Surgo Nov 6, 2018
f6fbcbe
Merge pull request #48 from uncovertruth/pyup-update-flake8-3.5.0-to-…
Surgo Nov 7, 2018
5fa63d5
bump version to 1.2.1 (#52)
opapy Nov 7, 2018
c2774ec
Update pymemcache from 2.0.0 to 2.1.1
pyup-bot Jan 28, 2019
aa4684b
Update flake8 from 3.6.0 to 3.7.5
pyup-bot Feb 5, 2019
c3f68fb
Merge pull request #59 from uncovertruth/pyup-update-flake8-3.6.0-to-…
Surgo Feb 18, 2019
697a284
Merge pull request #55 from uncovertruth/pyup-update-pymemcache-2.0.0…
Surgo Feb 18, 2019
d821aa5
Update supported versions
Surgo Jun 22, 2020
eab3e5a
Change maintener
Surgo Jun 23, 2020
5c604c4
Change deploy user
Surgo Jun 27, 2020
4238a0b
Bump version to 1.3.0
Surgo Jun 27, 2020
ee06a82
Reconfigure manifest file
Surgo Jun 27, 2020
24d3324
Install codecov in py38
Surgo Jun 27, 2020
72f0555
Merge pull request #93 from harikitech/topic/update_supported_versions
Surgo Jun 27, 2020
e572ff3
Install dependabot
Surgo Jun 27, 2020
ea60916
Good bye Python 3.5 (mock does not supported)
Surgo Jun 27, 2020
7bcdc65
Merge pull request #94 from harikitech/topic/upgrade_dependencies
Surgo Jun 27, 2020
e4ef0fe
Remove old token
Surgo Jun 27, 2020
faf5a57
Get CODECOV_TOKEN from environment variables
Surgo Jun 27, 2020
f852182
Merge pull request #100 from harikitech/topic/remove_old_token
Surgo Jun 27, 2020
f87c15e
Add more tests
Surgo Jun 27, 2020
915e31b
Bump version to 1.3.1
Surgo Jun 27, 2020
1fefcd0
Remove super's args
Surgo Jun 27, 2020
29e28ec
Merge pull request #101 from harikitech/topic/increase_test_coverage
Surgo Jun 27, 2020
7fa8d47
Support incr, decr and disconnect_all
Surgo Jun 27, 2020
d21d23b
Depends django-pymemcache
Surgo Jun 29, 2020
9a8e6e6
Add dependencies
Surgo Jun 29, 2020
7d5360c
Merge pull request #103 from harikitech/topic/depends_django_pymemcache
heavenshell Jun 29, 2020
fe3b55e
Rename class and module names (to respect pymemcache)
Surgo Jun 29, 2020
1546a86
Merge pull request #104 from harikitech/topic/rename_backend
Surgo Jun 29, 2020
8f2ceb6
Add ConfigurationEndpointClient based on pymemcache.client.Client
Surgo Jun 29, 2020
530fbfb
Use ConfigurationEndpointClient
Surgo Jun 29, 2020
9a5ab78
Remove old utils
Surgo Jun 29, 2020
40f4d47
Fix isort orders
Surgo Jun 29, 2020
af8203a
Remove unused module
Surgo Jun 29, 2020
11c764c
Add log
Surgo Jun 29, 2020
eaacc5e
Merge pull request #105 from harikitech/topic/migrate_to_pymemcache_c…
heavenshell Jun 29, 2020
48382bf
Remove unused option
Surgo Jun 29, 2020
4a22a99
Fix dependencies
Surgo Jun 29, 2020
c783c38
Bump version to 2.0.1
Surgo Jun 29, 2020
de5c951
Merge pull request #106 from harikitech/topic/fix_document
heavenshell Jun 29, 2020
999b5ab
Fix ValueError
Surgo Jun 29, 2020
8ff138b
Merge pull request #107 from harikitech/topic/fix_server
heavenshell Jun 30, 2020
5c0c55a
Bump version to 2.0.2
Surgo Jun 30, 2020
74d6eb3
Merge pull request #108 from harikitech/topic/bump/2.0.2
heavenshell Jun 30, 2020
45004ed
Support functools.wrap
Surgo Jun 30, 2020
19e74bc
Bump version to 2.0.3
Surgo Jun 30, 2020
ed53e89
Merge pull request #109 from harikitech/topic/fix_wrap_error
Surgo Jun 30, 2020
01b65aa
Bump isort from 4.3.21 to 5.0.6
dependabot[bot] Jul 10, 2020
03733bd
Merge pull request #114 from harikitech/dependabot/pip/isort-5.0.6
Surgo Jul 10, 2020
cc2b646
Bump coverage from 5.1 to 5.2
dependabot[bot] Jul 10, 2020
40b7a0b
Merge pull request #111 from harikitech/dependabot/pip/coverage-5.2
Surgo Jul 10, 2020
78efb2d
Bump isort from 5.0.6 to 5.0.9
dependabot[bot] Jul 13, 2020
e07ed2b
Merge pull request #115 from harikitech/dependabot/pip/isort-5.0.9
Surgo Jul 13, 2020
b00c011
Bump isort from 5.0.9 to 5.1.3
dependabot[bot] Jul 20, 2020
e96b4a1
Merge pull request #118 from harikitech/dependabot/pip/isort-5.1.3
Surgo Jul 20, 2020
ce1f947
Bump isort from 5.1.3 to 5.1.4
dependabot[bot] Jul 21, 2020
28ade7f
Merge pull request #119 from harikitech/dependabot/pip/isort-5.1.4
Surgo Jul 21, 2020
55f5df2
Bump coverage from 5.2 to 5.2.1
dependabot[bot] Jul 27, 2020
43dfaac
Bump isort from 5.1.4 to 5.2.0
dependabot[bot] Jul 28, 2020
388bbd5
Merge pull request #121 from harikitech/dependabot/pip/isort-5.2.0
Surgo Jul 28, 2020
41c58a5
Merge pull request #120 from harikitech/dependabot/pip/coverage-5.2.1
Surgo Jul 28, 2020
9c41f0e
Bump isort from 5.2.0 to 5.2.1
dependabot[bot] Jul 30, 2020
c6bf098
Merge pull request #122 from harikitech/dependabot/pip/isort-5.2.1
Surgo Jul 30, 2020
bde60db
Bump isort from 5.2.1 to 5.3.2
dependabot[bot] Aug 10, 2020
e0b344b
Fix wrong command
Surgo Aug 10, 2020
6377f3c
Fix check-manifest bugs
Surgo Aug 10, 2020
3730a37
Merge pull request #125 from harikitech/dependabot/pip/isort-5.3.2
Surgo Aug 10, 2020
f8f01cc
Add support for Django 3.1
Surgo Aug 10, 2020
6a8c5fc
Fix backward imcompatible changes
Surgo Aug 10, 2020
84af982
Merge pull request #126 from harikitech/topic/support_django31
heavenshell Aug 10, 2020
239ad3c
Bump version to 2.0.4
Surgo Aug 10, 2020
a8916c9
Merge pull request #127 from harikitech/topic/bump/2.0.4
heavenshell Aug 10, 2020
54dd564
Bump pymemcache from 3.2.0 to 3.3.0
dependabot[bot] Aug 20, 2020
31c76b9
Bump isort from 5.3.2 to 5.5.0
dependabot[bot] Sep 4, 2020
0da4e16
Merge pull request #131 from harikitech/dependabot/pip/isort-5.5.0
Surgo Sep 4, 2020
32bdf4d
Merge pull request #130 from harikitech/dependabot/pip/pymemcache-3.3.0
Surgo Sep 4, 2020
a1c90de
resolve merge conflict with branch django-elastipymemcache
matteiuspi Mar 19, 2021
ae40a1f
port the change over that we care about.
matteiuspi Mar 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
time: '09:00'
timezone: Asia/Tokyo
open-pull-requests-limit: 10
104 changes: 84 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,101 @@
### https://raw.github.com/github/gitignore/f57304e9762876ae4c9b02867ed0cb887316387e/python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
lib
lib64
__pycache__
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.tox
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site


# Mr Developer
.mr.developer.cfg
.project
.pydevproject
.idea
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
sudo: false
language: python
python:
- 3.6
- 3.7
- 3.8
cache: pip
env:
- DJANGO=2.2
- DJANGO=3.0
- DJANGO=3.1
- DJANGO=dev

matrix:
include:
- python: 3.8
env: TOXENV=flake8
- python: 3.8
env: TOXENV=isort
- python: 3.8
env: TOXENV=readme
- python: 3.8
env: TOXENV=check-manifest
allow_failures:
- env: DJANGO=dev
install:
- travis_retry python3 -m pip install tox-travis
script:
- tox
deploy:
provider: pypi
username: __token__
password:
secure: "HBbDdcrrzRrSXbQGz3cz24/xNIW77tVlHQ+D6DS5raOSV7en5CPaiWZ50YkMQa08nfBOR1RBT8JivrC05qz1+TqMwOz0+rinFeGPmu9gLY8f+1kx0UZnmXG7GHsm6dBGOP6nIHA40+rtK/YLuhskdd2hEBIOAuAxXuCSd1UQ/3bj/nuspDwcot9OdJiyn+Xl+cjI39Gt8WlF7ZBjgFRw1hNSIJ2f0or38zf+SSDY6QgKiJZCn+4sooy0assCms84LSKumSl7Ya50IWwBGJgJaNPxikqgTf3rDP9bT25OLtJw78zJnO4QC2PJ9Y7j2tzeYkelHJM794uAtKNaW1SanlYdBXQoE7m1CE8DszZxCtN/siuz+30whFJ885pPaSN3m5uJct/v9GxBEAHtoCrwwdfrTvzVCU43PGwPZvO768k465rRGUnBInLybO5hTq6myajecZB2WhVXMh7/KMcXlVtnD5PvIhxLkLPVIGBK+1wFfvH/4ijZl8Dhz5PXP53AcX/Ohdli7+kd9DQEvieE2bhDpBaJq2r7B4etW/bjz76GQ704uzuF5JXXEibaT1fox8nqJzghuWfcXJvoTa20iR1quuHg0Z4qBIYh76CUXafi4iIZ0fCcIDVPWM7KSp1rvt4BgCdi1csQdTasw0l0WGoKdOSu+LlNSrqzPLoXQlE="
distributions: sdist bdist_wheel
skip_upload_docs: true
on:
repo: harikitech/django-elastipymemcache
tags: true
python: 3.8
condition: "$DJANGO = 3.0"
notifications:
email: false
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

14 changes: 12 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
include LICENSE
include README.rst
include MANIFEST.in
include setup.py

exclude requirements.txt
exclude tox.ini

global-exclude __pycache__
global-exclude *.py[co]

prune .github
prune tests

graft django_elastipymemcache
126 changes: 25 additions & 101 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
Amazon ElastiCache backend for Django
=====================================
=======================
django-elastipymemcache
=======================

.. index: README
.. image:: https://travis-ci.org/harikitech/django-elastipymemcache.svg?branch=master
:target: https://travis-ci.org/harikitech/django-elastipymemcache
.. image:: https://codecov.io/gh/harikitech/django-elastipymemcache/branch/master/graph/badge.svg
:target: https://codecov.io/gh/harikitech/django-elastipymemcache

Purpose
-------

Simple Django cache backend for Amazon ElastiCache (memcached based). It uses
`pylibmc <http://github.com/lericson/pylibmc>`_ and sets up a connection to each
`pymemcache <https://github.com/pinterest/pymemcache>`_ and sets up a connection to each
node in the cluster using
`auto discovery <http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html>`_.

Originally forked from `django-elasticache <https://github.com/gusdan/django-elasticache>`_.

Requirements
------------

* pylibmc
* Django 1.5+.

It was written and tested on Python 2.7 and 3.4.
* pymemcache
* Django>=2.2
* django-pymemcache>=1.0

Installation
------------

Get it from `pypi <http://pypi.python.org/pypi/django-elasticache>`_::

pip install django-elasticache

or `github <http://github.com/gusdan/django-elasticache>`_::

pip install -e git://github.com/gusdan/django-elasticache.git#egg=django-elasticache
Get it from `pypi <http://pypi.python.org/pypi/django-elastipymemcache>`_::

pip install django-elastipymemcache

Usage
-----
Expand All @@ -34,95 +38,15 @@ Your cache backend should look something like this::

CACHES = {
'default': {
'BACKEND': 'django_elasticache.memcached.ElastiCache',
'LOCATION': 'cache-c.draaaf.cfg.use1.cache.amazonaws.com:11211',
'OPTIONS' {
'IGNORE_CLUSTER_ERRORS': [True,False],
},
}
}

By the first call to cache it connects to cluster (using ``LOCATION`` param),
gets list of all nodes and setup pylibmc client using full
list of nodes. As result your cache will work with all nodes in cluster and
automatically detect new nodes in cluster. List of nodes are stored in class-level
cached, so any changes in cluster take affect only after restart of working process.
But if you're using gunicorn or mod_wsgi you usually have max_request settings which
restart process after some count of processed requests, so auto discovery will work
fine.

The ``IGNORE_CLUSTER_ERRORS`` option is useful when ``LOCATION`` doesn't have support
for ``config get cluster``. When set to ``True``, and ``config get cluster`` fails,
it returns a list of a single node with the same endpoint supplied to ``LOCATION``.

Django-elasticache changes default pylibmc params to increase performance.

Another solutions
-----------------

ElastiCache provides memcached interface so there are three solution of using it:

1. Memcached configured with location = Configuration Endpoint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In this case your application
will randomly connect to nodes in cluster and cache will be used with not optimal
way. At some moment you will be connected to first node and set item. Minute later
you will be connected to another node and will not able to get this item.

::

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': 'cache.gasdbp.cfg.use1.cache.amazonaws.com:11211',
'BACKEND': 'django_elastipymemcache.backend.ElastiPymemcache',
'LOCATION': '[configuration endpoint]:11211',
'OPTIONS': {
'ignore_exc': True, # pymemcache Client params
'ignore_cluster_errors': True, # ignore get cluster info error
}
}
}


2. Memcached configured with all nodes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It will work fine, memcache client will
separate items between all nodes and will balance loading on client side. You will
have problems only after adding new nodes or delete old nodes. In this case you should
add new nodes manually and don't forget update your app after all changes on AWS.

::

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
'LOCATION': [
'cache.gqasdbp.0001.use1.cache.amazonaws.com:11211',
'cache.gqasdbp.0002.use1.cache.amazonaws.com:11211',
]
}
}


3. Use django-elasticache
~~~~~~~~~~~~~~~~~~~~~~~~~

It will connect to cluster and retrieve ip addresses
of all nodes and configure memcached to use all nodes.

::

CACHES = {
'default': {
'BACKEND': 'django_elasticache.memcached.ElastiCache',
'LOCATION': 'cache-c.draaaf.cfg.use1.cache.amazonaws.com:11211',
}
}


Difference between setup with nodes list (django-elasticache) and
connection to only one configuration Endpoint (using dns routing) you can see on
this graph:

.. image:: https://raw.github.com/gusdan/django-elasticache/master/docs/images/get%20operation%20in%20cluster.png

Testing
-------

Expand Down
Loading