- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
""" in utils.py"""
try:
mongo = pymongo.Connection(settings.MONGO_HOST).topbrands
except:
# it's ok, nobody dies
mongo = None
''''everywhere"""
from utils import mongo
try:
mongo.objects.save(obj)
except Exception, e:
log.exception(e)