# Path: web/config/conf.py
# DEBUG_MODE          = True
# LESS_DEBUG          = True
# JS_DEBUG            = True
# PRODUCTION          = False
# SITENAME            = "GREADER"#your site here
# SITE_DOMAIN         = ""#your site here
# PORT                = "5000"
# SECRET_KEY          = "secret_keyplzchangeit"
# MONGODB_DB          = "conure"#project db
# MONGODB_DB_UNITTEST = "conure_unittest"#project unittest
# MONGODB_HOST        = "localhost"
# MONGODB_PORT        = 27017
# MONGODB_USER        = ''#your mongodb username; keep it empty if no auth required
# MONGODB_PASSWD      = ''#your mongodb pwd; keep it empty if no auth required
# SENTRY_DSN          = ''#somethinf about sentry
# SITE = "http://" + SITE_DOMAIN + ":" + PORT


import os
from flask.ext.mongoengine import MongoEngine
from web.config import conf
# coding:utf8




def get_db(database=None):
    if not database:
        database = conf.MONGODB_DB
    if os.environ.get("UNITTEST_MODE"):
        database = conf.MONGODB_DB_UNITTEST
    mongo = MongoEngine()
    mongo.connect(
        database,

# Path: web/config/conf.py
# DEBUG_MODE          = True
# LESS_DEBUG          = True
# JS_DEBUG            = True
# PRODUCTION          = False
# SITENAME            = "GREADER"#your site here
# SITE_DOMAIN         = ""#your site here
# PORT                = "5000"
# SECRET_KEY          = "secret_keyplzchangeit"
# MONGODB_DB          = "conure"#project db
# MONGODB_DB_UNITTEST = "conure_unittest"#project unittest
# MONGODB_HOST        = "localhost"
# MONGODB_PORT        = 27017
# MONGODB_USER        = ''#your mongodb username; keep it empty if no auth required
# MONGODB_PASSWD      = ''#your mongodb pwd; keep it empty if no auth required
# SENTRY_DSN          = ''#somethinf about sentry
# SITE = "http://" + SITE_DOMAIN + ":" + PORT


# Path: web/util/db.py
import os
from flask.ext.mongoengine import MongoEngine
from web.config import conf

# coding:utf8




def get_db(database=None):
    if not database:
        database = conf.MONGODB_DB
    if os.environ.get("UNITTEST_MODE"):
        database = conf.MONGODB_DB_UNITTEST
    mongo = MongoEngine()
    mongo.connect(
        database,

        host=conf.MONGODB_HOST,