Пример #1
0
 def index(self):
     return render(title=render('__server_info__'),
                   content="""<ul style="list-style:none">
                                         <li><a href="/login">Login</a></li>
                                         <li><a href="/batches">My Batches</a></li>
                                         <li><a href="/upload">Upload a file</a></li>
                                         </ul>""")
Пример #2
0
def main():
    cherrypy.config.update({'error_page.404': err_pages.err_404})
    # = Daemonizer(cherrypy.engine)
    #d.subscribe()
    AppDispatcher = WSGIPathInfoDispatcher({
        '/':
        cherrypy.tree.mount(Main(), '/', config=config),
        #'/login': LoginApp,
        '/file':
        FileApp
    })
    server = CherryPyWSGIServer((settings['ip'], settings['port']),
                                AppDispatcher,
                                server_name=render('__server_info__'),
                                numthreads=100,
                                request_queue_size=70)

    serverSSL = None

    if settings.has_key('ssl_certificate') and settings.has_key(
            'ssl_private_key'):
        if os.path.exists(settings['ssl_certificate']) and os.path.exists(
                settings['ssl_private_key']):
            serverSSL = CherryPyWSGIServer(
                (settings['ip'], settings['sslport']),
                AppDispatcher,
                server_name=render('__server_info__'),
                numthreads=100,
                request_queue_size=70)
            serverSSL.ssl_certificate = settings['ssl_certificate']
            serverSSL.ssl_private_key = settings['ssl_private_key']
            s2 = ServerAdapter(cherrypy.engine, serverSSL)
            s2.subscribe()
    s1 = ServerAdapter(cherrypy.engine, server)
    s1.subscribe()
    check_create_db(settings['db_name'], settings['db_name'])
    cherrypy.engine.timeout_monitor.unsubscribe()
    cherrypy.engine.start()
    cherrypy.engine.block()
Пример #3
0
def main():
    cherrypy.config.update({'error_page.404': err_pages.err_404})
    # = Daemonizer(cherrypy.engine)
    #d.subscribe()
    AppDispatcher = WSGIPathInfoDispatcher({'/': cherrypy.tree.mount(Main(),'/',config=config),
                                            #'/login': LoginApp,
                                            '/file': FileApp
                                            })
    server = CherryPyWSGIServer(
                                (settings['ip'], settings['port']), 
                                AppDispatcher,
                                server_name=render('__server_info__'), 
                                numthreads=100, 
                                request_queue_size=70
                                )

    serverSSL = None
    
    if settings.has_key('ssl_certificate') and settings.has_key('ssl_private_key'):
        if os.path.exists(settings['ssl_certificate']) and os.path.exists(settings['ssl_private_key']):
                serverSSL = CherryPyWSGIServer(
                               (settings['ip'], settings['sslport']), 
                               AppDispatcher,
                               server_name=render('__server_info__'), 
                               numthreads=100, 
                               request_queue_size=70
                               )
                serverSSL.ssl_certificate = settings['ssl_certificate']
                serverSSL.ssl_private_key = settings['ssl_private_key']
                s2 = ServerAdapter(cherrypy.engine, serverSSL)
                s2.subscribe()
    s1 = ServerAdapter(cherrypy.engine, server)
    s1.subscribe()
    check_create_db(settings['db_name'],settings['db_name'])
    cherrypy.engine.timeout_monitor.unsubscribe()
    cherrypy.engine.start()
    cherrypy.engine.block()
Пример #4
0
 def index(self):
     return render(title=render('__server_info__'),content="""<ul style="list-style:none">
                                         <li><a href="/login">Login</a></li>
                                         <li><a href="/batches">My Batches</a></li>
                                         <li><a href="/upload">Upload a file</a></li>
                                         </ul>""")