fix(settings): fixes wrong cache config used for heroku

* Installs `django-heroku-memcacheify` only on heroku to 
  avoid installing `libmemcached-dev`[1] locally. 

[1] https://github.com/rdegges/django-heroku-memcacheify#install

Fixes: https://github.com/pydanny/cookiecutter-django/issues/80
This commit is contained in:
Saurabh Kumar 2014-03-22 22:32:27 +05:30
parent 1ad866770a
commit cfa787384d
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
# This file is here because many Platforms as a Service look for # This file is here because many Platforms as a Service look for
# requirements.txt in the root directory of a project. # requirements.txt in the root directory of a project.
pylibmc==1.2.3 # pylibmc==1.2.3
django-heroku-memcacheify==0.5
-r requirements/production.txt -r requirements/production.txt

View File

@ -388,6 +388,11 @@ class Production(Common):
########## CACHING ########## CACHING
# Only do this here because thanks to django-pylibmc-sasl and pylibmc memcacheify is painful to install on windows. # Only do this here because thanks to django-pylibmc-sasl and pylibmc memcacheify is painful to install on windows.
try:
# See: https://github.com/rdegges/django-heroku-memcacheify
from memcacheify import memcacheify
CACHES = memcacheify()
except ImportError:
CACHES = values.CacheURLValue(default="memcached://127.0.0.1:11211") CACHES = values.CacheURLValue(default="memcached://127.0.0.1:11211")
########## END CACHING ########## END CACHING