Skip to content

Commit f53f710

Browse files
committed
Switch from abandoned python-memcached to pylibmc
See linsomniac/python-memcached#95
1 parent 136b491 commit f53f710

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

‎docs/source/upgrade/upgrade-to-tendenci8.txt‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Make sure the required system dependencies are installed:
1919
libjpeg8 libjpeg-dev libfreetype6 libfreetype6-dev
2020
sudo apt-get install curl wget
2121

22+
If this is a live site using memcached, also make sure libmemcached-dev is installed:
23+
::
24+
25+
sudo apt-get install libmemcached-dev
2226

2327
Shut down Tendenci:
2428
::
@@ -60,6 +64,9 @@ Tendenci and Python upgrades):
6064

6165
cd /var/www/tendenci/
6266
source /srv/tendenci/bin/activate
67+
# For development installations:
68+
pip install --no-binary psycopg2 -r requirements/dev.txt --upgrade
69+
# For live sites:
6370
pip install --no-binary psycopg2 -r requirements/prod.txt --upgrade
6471

6572

@@ -100,6 +107,9 @@ Upgrade Tendenci and its dependencies:
100107
sudo chown -Rh "$(id -u -n)": /srv/tendenci/
101108
source /srv/tendenci/venv/bin/activate # For Python 2
102109
source /srv/tendenci/bin/activate # For Python 3
110+
# For development installations:
111+
pip install --no-binary psycopg2 -r requirements/dev.txt --upgrade
112+
# For live sites:
103113
pip install --no-binary psycopg2 -r requirements/prod.txt --upgrade
104114

105115

@@ -267,6 +277,9 @@ shown in the "Custom Application Settings" section of the latest
267277
`settings.py <https://github.com/tendenci/tendenci-project-template/blob/tendenci8/conf/settings.py>`_
268278
file.
269279

280+
Replace ``django.core.cache.backends.memcached.MemcachedCache`` with
281+
``django.core.cache.backends.memcached.PyLibMCCache``
282+
270283
If present, replace ``tendenci.apps.theme.template_loaders.Loader`` with
271284
``tendenci.apps.theme.template_loaders.ThemeLoader``
272285

‎requirements.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ chardet==3.0.3
4343
psycopg2>=2.7,<2.8
4444
gunicorn==19.5.0
4545
django-storages==1.4.1
46-
python-memcached==1.59
4746
Whoosh==2.7.4
4847
simple-salesforce==0.68.1
4948
selenium==2.53.2

‎tendenci/settings.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,15 @@ def disable_template_cache(): # For use in site-specific settings.py
303303

304304
CACHES = {
305305
'default': {
306-
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
306+
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
307307
'LOCATION': '127.0.0.1:11211',
308308
'TIMEOUT': 60*60*24*30, # 30 days
309309
}
310310
}
311+
try:
312+
import pylibmc
313+
except ImportError:
314+
CACHES['default']['BACKEND'] = 'django.core.cache.backends.dummy.DummyCache'
311315

312316
LOGGING = {
313317
'version': 1,

0 commit comments

Comments
 (0)