Files
edx-platform/common/lib/keystore/django.py
2012-06-18 13:41:53 -04:00

22 lines
413 B
Python

"""
Module that provides a connection to the keystore specified in the django settings.
Passes settings.KEYSTORE as kwargs to MongoKeyStore
"""
from __future__ import absolute_import
from django.conf import settings
from .mongo import MongoKeyStore
_KEYSTORE = None
def keystore():
global _KEYSTORE
if _KEYSTORE is None:
_KEYSTORE = MongoKeyStore(**settings.KEYSTORE)
return _KEYSTORE