Browse files

Please

  • Loading branch information...
1 parent 05531ee commit 7cfeced2cd02863f9c3c2bbf1656fd142112fb6f @blackrobot blackrobot committed Apr 19, 2012
Showing with 15 additions and 12 deletions.
  1. +15 −12 source/settings/heroku.py
View
27 source/settings/heroku.py
@@ -62,18 +62,21 @@
)
# Memcachedddd
-CACHES = {
- 'default': {
- 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
- # 'LOCATION': env('MEMCACHE_SERVERS', ''),
- 'TIMEOUT': 300,
- 'BINARY': True,
- 'OPTIONS': {
- 'tcp_nodelay': True,
- 'ketama': True,
- }
- },
-}
+if 'MEMCACHE_SERVERS' in environ:
+ CACHES = {
+ 'default': {
+ 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
+ 'LOCATION': "%s:11211" % env('MEMCACHE_SERVERS', ''),
+ 'username': env('MEMCACHE_USERNAME', ''),
+ 'password': env('MEMCACHE_PASSWORD', ''),
+ 'TIMEOUT': 300,
+ 'BINARY': True,
+ 'OPTIONS': {
+ 'tcp_nodelay': True,
+ 'ketama': True,
+ }
+ },
+ }
# Only cache for anonymous users
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

0 comments on commit 7cfeced

Please sign in to comment.