MemCachier in Heroku just got easier in Django
All you need to do is:
And add the following to settings.py:
Then, to test if it’s working, run:
$ heroku run python manage.py shell Running python manage.py shell attached to terminal... up, run.1 Python 2.7.2 (default, Oct 31 2011, 16:22:04) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from django.core.cache import cache >>> cache.set('memcache', 'ify!') True >>> cache.get('memcache') 'ify!' >>>
Checkout django-heroku-memcacheify on github for more information. Thanks, Randall!
UPDATE: these instructions will be even easier once this pull request is merged. Once it’s merged, you won’t need to muck with environment variables at all.