django-select2/django_select2/cache.py
2015-09-29 13:54:23 +02:00

23 lines
631 B
Python

# -*- coding: utf-8 -*-
"""
Shared memory across multiple machines to the heavy ajax lookups.
Select2 uses django.core.cache_ to share fields across
multiple threads and even machines.
Select2 uses the cabhe backend defind in the setting
``SELECT2_CACHE_BACKEND`` [default=``default``].
It is advised to always setup a separate cache server for Select2.
.. _django.core.cache: https://docs.djangoproject.com/en/dev/topics/cache/
"""
from __future__ import absolute_import, unicode_literals
from django.core.cache import caches
from .conf import settings
__all__ = ('cache', )
cache = caches[settings.SELECT2_CACHE_BACKEND]