Skip to content

Instantly share code, notes, and snippets.

@blackrobot
Created May 6, 2013 17:04
Show Gist options
  • Save blackrobot/5526433 to your computer and use it in GitHub Desktop.
Save blackrobot/5526433 to your computer and use it in GitHub Desktop.
from django.conf import settings
from django.core import cache
from micawber.providers import bootstrap_embedly as _bootstrap_embedly
def bootstrap_embedly():
""" This bootstraps micawber with the embedly bootstrapper, but uses a
specific cache.
"""
return _bootstrap_embedly(cache.get_cache(settings.MICAWBER_CACHE_NAME),
key=settings.MICAWBER_EMBEDLY_KEY)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1',
},
'filecache': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': '/var/tmp/django_cache',
'TIMEOUT': 60 * 60 * 24 * 60, # 60 Days
'MAX_ENTRIES': 5000,
},
}
# Micawber
MICAWBER_CACHE_NAME = 'filecache'
MICAWBER_PROVIDERS = 'source.utils.embedly.bootstrap_embedly'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment