示例#1
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    settings['staticapp'] = get_static_urlparser(pkg_resources.resource_filename(__name__, 'static'))
    
    settings['secret_key'] = "ci28228zs7s8c6c8976c89c7s6s8976cs87d6" #os.urandom(20)
    settings['log'] = logbook.Logger("pythoncamp")
    settings.update(kw)
    return settings
示例#2
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    settings['css'] = CSSResourceManager(CSS, prefix_url="/css", auto_reload=True)
    settings['js'] = JSResourceManager(JS, prefix_url="/js", auto_reload=True)
    settings['staticapp'] = get_static_urlparser(pkg_resources.resource_filename(__name__, 'static'))
    
    settings['log'] = logbook.Logger("frontend")
    settings.update(kw)
    return settings
示例#3
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    
    settings['secret_key'] = "czs7s8c6c8976c89c7s6s8976cs87d6" #os.urandom(20)
    settings['log'] = logbook.Logger("werateit")
    settings.update(kw)
    settings.mdb = mdb = pymongo.Connection().werateit
    settings.domain_db = db.Domains(mdb, "domains")
    return settings
示例#4
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    settings['imageapp'] = get_static_urlparser("/tmp")
    #tmpls = settings['templates'] = TemplateHandler(__name__)
    
    settings['log'] = logbook.Logger("quantumlounge")

    # TODO: enable updating of sub settings via dot notation (pm.client_id)
    settings.update(kw)
    return settings
示例#5
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    settings["css"] = CSSResourceManager(CSS, prefix_url="/css", auto_reload=True)
    settings["js"] = JSResourceManager(JS, prefix_url="/js", auto_reload=True)
    settings["staticapp"] = get_static_urlparser(pkg_resources.resource_filename(__name__, "static"))

    settings["secret_key"] = "ci28228zs7s8c6c8976c89c7s6s8976cs87d6"  # os.urandom(20)
    settings["log"] = logbook.Logger("frontend")
    settings.update(kw)
    settings.mdb = mdb = pymongo.Connection().werateit
    settings.domain_db = db.Domains(mdb, "domains")
    return settings
示例#6
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()
    # wo liegt der User Server?
    settings['userserver'] = "http://*****:*****@me/profile"
    settings['pm'] = pm
    
    # setup CSS and JS according to the vpath
    vpath = settings.virtual_path
    settings['css_resources'] = CSSResourceManager(CSS, prefix_url=vpath+"/css", auto_reload=True)
    settings['js_resources'] = JSResourceManager(JS, prefix_url=vpath+"/js", auto_reload=True)
    return settings
示例#7
0
文件: setup.py 项目: mrtopf/jmstvcamp
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
示例#8
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()

    settings['log'] = logbook.Logger("ql.um.simple")

    # database
    settings.db = db = pymongo.Connection().pm

    # path
    settings['virtual_path'] = ""

    # update the settings with the keywords passed in
    # TODO: enable updating of sub settings via dot notation (pm.client_id)
    settings.update(kw)

    # now setup the user store
    settings.users = users.Users(settings.user_store_filename)
    settings.clients = clients.Clients(settings.client_store_filename)
    settings.tokens = tokens.Tokens()
    settings.authmanager = tokens.AuthManager(settings.tokens)
    return settings
示例#9
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
示例#10
0
def setup(**kw):
    """initialize the setup"""
    settings = AttributeMapper()

    settings.um_client_id = "example_client" # you should change this in settings
    settings.um_client_secret = "ex1" # you should change this in settings
    settings.um_poco_endpoint = "http://localhost:9992/1/users"

    settings.log = logbook.Logger("ql.backend")

    ## our database connection (TODO: should this be overridable?)
    settings.db = db = pymongo.Connection().pm

    # now we create the content type manager and register the content types
    ctm = ContentTypeManager()
    ctm.add(StatusType(db, "contents"))
    ctm.add(FolderType(db, "contents"))
    ctm.add(LinkType(db, "contents"))
    settings.content1=ctm # not sure if this is actually needed (TODO)

    # this is the main database handler. It retrieves and stores objects
    # we initialize it with the database, the collection name and the 
    # root node. 
    settings.contentmanager = ContentManager(db, "contents", ctm, "0")

    # this is the registry containing a mapping from type names to a list
    # of representations available for this type
    # TODO: Should this be part of the content types? Probably, but the question
    # is if we still want to keep python API and RESTful API seperate and this
    # is more a RESTful thing
    settings.representations = rest.registry.representations
    settings.views = rest.registry.views
    
    # the base path under which this application runs, usually on root
    # example: "/myapi"
    settings.virtual_path = ""

    # the auth manager which needs to support the ``get(access_token)`` method
    # which has to return some session object which identifies the user and
    # has a ``roles`` attribute.
    settings.authmanager = rest.auth.Sessions(settings)

    # update the settings with the keywords passed in
    # TODO: enable updating of sub settings via dot notation (pm.client_id)
    settings.update(kw)
    return settings