Пример #1
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    settings['staticapp'] = get_static_urlparser(
        pkg_resources.resource_filename(__name__, 'static'))

    settings[
        'secret_key'] = "ccdhsiuccdhsiuhhci28228zs7s8c6c8976c89c7s6s8976cs87d6"  #os.urandom(20)
    settings['log'] = logbook.Logger("jmstvcamp")
    settings['dbname'] = "jmstvcamp"
    settings['shared_secret'] = "c6cs8cd67c8s76c9cs76ds98c76scds"
    settings['usercoll'] = "users"
    settings['maxpeople'] = 100
    settings['mailername'] = "real"
    settings.update(kw)

    settings.pts = Environment(loader=PackageLoader("jmstvcamp", "pages"))
    settings.email_templates = Environment(
        loader=PackageLoader("jmstvcamp", "email_templates"))

    settings.db = pymongo.Connection()[settings.dbname]
    settings.userdb = settings.db[settings.usercoll]
    settings.users = db.Users(settings)
    settings.maxpeople = int(settings.maxpeople)
    settings.mailer = emails.MAILERS[settings.mailername]()
    return settings
Пример #2
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    settings['staticapp'] = get_static_urlparser(pkg_resources.resource_filename(__name__, 'static'))
    
    settings['secret_key'] = "ccdhsiuccdhsiuhhci28228zs7s8c6c8976c89c7s6s8976cs87d6" #os.urandom(20)
    settings['log'] = logbook.Logger("jmstvcamp")
    settings['dbname'] = "jmstvcamp"
    settings['shared_secret'] = "c6cs8cd67c8s76c9cs76ds98c76scds"
    settings['usercoll'] = "users"
    settings['maxpeople'] = 100
    settings['mailername'] = "real"
    settings.update(kw)

    settings.pts = Environment(loader=PackageLoader("jmstvcamp","pages"))
    settings.email_templates = Environment(loader=PackageLoader("jmstvcamp","email_templates"))

    settings.db = pymongo.Connection()[settings.dbname]
    settings.userdb = settings.db[settings.usercoll]
    settings.users = db.Users(settings)
    settings.maxpeople = int(settings.maxpeople)
    settings.mailer = emails.MAILERS[settings.mailername]()
    return settings