示例#1
0
文件: util.py 项目: youngdev/pyjojo
def create_application(debug):
    application = tornado.web.Application(route.get_routes(),
                                          scripts=create_collection(
                                              config['directory']),
                                          debug=debug)

    return application
示例#2
0
def create_application(debug):
    application = tornado.web.Application(
        route.get_routes(), 
        scripts=create_collection(config['directory']),
        debug=debug
    )
    
    return application
示例#3
0
def create_application(debug):
    # import the handler file, this will fill out the route.get_routes() call.
    import pyjojo.handlers

    application = tornado.web.Application(
        route.get_routes(), 
        scripts=create_collection(config['directory']),
        debug=debug
    )
    
    return application
示例#4
0
文件: util.py 项目: CartoDB/pyjojo
def create_application(debug):
    # import the handler file, this will fill out the route.get_routes() call.
    import pyjojo.handlers

    application = tornado.web.Application(
        route.get_routes(), 
        scripts=create_collection(config['directory']),
        debug=debug
    )
    
    return application
示例#5
0
文件: util.py 项目: bdunbar/pyjojo
def main():
    """ entry point for the application """
    
    root = os.path.dirname(__file__)
        
    # get the command line options
    options = command_line_options()
    handler = setup_logging()

    # import the handler file, this will fill out the route.get_routes() call.
    import pyjojo.handlers

    # setup the application
    log.info("Setting up the application")
    
    application = tornado.web.Application(
        route.get_routes(), 
        scripts=create_collection(config['directory']),
        debug=options.debug
    )
    
    # if we're passed a certfile and keyfile, start the app as an HTTPS server, 
    # otherwise use HTTP. 
    if options.certfile and options.keyfile:        
        server = HTTPServer(application, ssl_options={
            "certfile": options.certfile,
            "keyfile": options.keyfile
        })
    else:
        log.warn("Application is running in HTTP mode, this is insecure.  Pass in the --certfile and --keyfile to use SSL.")
        server = HTTPServer(application)

    # set the server port and fork subprocesses to run
    server.bind(options.port, options.address)
    server.start(1)
    
    # start the ioloop
    log.info("Starting the IOLoop")
    IOLoop.instance().start()
示例#6
0
 def post(self):
     """ reload the scripts from the script directory """
     self.settings['scripts'] = create_collection(config['directory'])
     self.finish({"status": "ok"})