Ejemplo n.º 1
0
def run(args=sys.argv):
    manage(
        dict(
            # sqlalchemy session
            server=App(app.wsgi_app),
            flup=Flup(app.wsgi_app, **app.cfg.FLUP_ARGS),
        ),
        args)
Ejemplo n.º 2
0
def manage(modules, paths=[]):
    add_paths(paths)
    from iktomi.cli import manage
    commands = {}
    for module in modules:
        m = __import__(module)
        commands.update(m.Application.cli_dict)
    manage(commands)
Ejemplo n.º 3
0
def run(args=sys.argv):
    manage(dict(
        # sqlalchemy session
        db = db_command,
        i18n = i18n_command,
        err = err_command,

        # dev-server
        admin = admin_command,
        front = front_command,
 
        admin_fcgi = admin_fcgi_command,
        front_fcgi = front_fcgi_command,
    ), args)
Ejemplo n.º 4
0
from iktomi import web
from iktomi.cli import app, fcgi, manage
import os
import sys
import logging

webapp = web.Application(
    web.cases(
        web.match('/', 'index') | (lambda e, d: web.Response('hello world'))),
    web.AppEnvironment)


# adding custom logging config to test bootstrapping
def bootstrap():
    logpath = os.path.join(os.path.dirname(__file__), 'hello.log')
    hellolog = logging.FileHandler(logpath)
    logging.root.handlers.append(hellolog)


devapp = app.App(webapp, bootstrap=bootstrap)
fcgi_sock_path = os.path.join(os.path.dirname(__file__), 'fcgi.sock')
fcgi_app = fcgi.Flup(webapp,
                     bind=fcgi_sock_path,
                     cwd=os.path.dirname(__file__))

if __name__ == '__main__':
    manage(dict(dev=devapp, fcgi=fcgi_app))
Ejemplo n.º 5
0
from iktomi import web
from iktomi.cli import app, fcgi, manage
import os
import sys
import logging

webapp = web.Application(web.cases(
    web.match('/', 'index') | (lambda e, d: web.Response('hello world'))
), web.AppEnvironment)

# adding custom logging config to test bootstrapping
def bootstrap():
    logpath = os.path.join(os.path.dirname(__file__),
                          'hello.log')
    hellolog = logging.FileHandler(logpath)
    logging.root.handlers.append(hellolog)

devapp = app.App(webapp, bootstrap=bootstrap)
fcgi_sock_path = os.path.join(os.path.dirname(__file__), 'fcgi.sock')
fcgi_app = fcgi.Flup(webapp, bind=fcgi_sock_path, cwd=os.path.dirname(__file__))


if __name__=='__main__':
    manage(dict(dev=devapp,
                fcgi=fcgi_app))
Ejemplo n.º 6
0
def run(args=sys.argv):
    manage(dict(
        # sqlalchemy session
        server=App(app.wsgi_app),
        flup=Flup(app.wsgi_app, **app.cfg.FLUP_ARGS),
    ), args)