We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need to use this code:
# enable sunlight cache setattr(sunlight.config, 'MONGO_HOST', C.Mgr.MONGO_HOST) sunlight.cache.response_cache = sunlight.cache.MongoBackend()
The code in the document will throw exception:
import logging from sunlight import response_cache response_cache.enable('mongo') response_cache.logger.setLevel(logging.DEBUG) Exception: --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /home/chengguangnan/anaconda3/lib/python3.5/site-packages/sunlight/cache.py in set_backend(self, backend_name) 107 try: --> 108 self.backend = backends[backend_name]() 109 self.logger.info('Changed cache backend to %r.' % self.backend) KeyError: 'mongo' During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) <ipython-input-24-2766d9958dbe> in <module>() 1 import logging 2 from sunlight import response_cache ----> 3 response_cache.enable('mongo') 4 response_cache.logger.setLevel(logging.DEBUG) /home/chengguangnan/anaconda3/lib/python3.5/site-packages/sunlight/cache.py in set_backend(self, backend_name) 109 self.logger.info('Changed cache backend to %r.' % self.backend) 110 except KeyError: --> 111 raise ValueError('No backend named %r is defined.' % backend_name) 112 113 enable = set_backend ValueError: No backend named 'mongo' is defined.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I need to use this code:
The code in the document will throw exception:
The text was updated successfully, but these errors were encountered: