Example #1
0
# -*- coding: utf-8 -*-
import sys

############################################################################
from accost import make_application
from accost.middlewares import *

############################################################################
import yido

############################################################################
application = make_application(yido)
# application.addMiddleware(TimeMiddleware())
# application.addMiddleware(SQLDisplayMiddleware(sys.stdout))


if __name__ == "__main__":
    from yido import models
    import sys
    import os

    def run_cherrypy_server(
        hostname=("h", ""),
        port=("p", 9999),
        threads=10,
        server_name="localhost",
        max=-1,
        request_queue_size=5,
        timeout=10,
    ):
        """run cherrypy server"""
Example #2
0
import logging
logging.basicConfig(
        level = logging.DEBUG,
        format = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
        filename = os.path.abspath(
            os.path.join(os.path.dirname(__file__), 'tuoguan.log')
        ),
        filemode = 'a'
)
############################################################################
from accost import make_application
from accost.middlewares import *
############################################################################
import www
############################################################################
application = make_application(www)
#application.addMiddleware(TimeMiddleware())
#application.addMiddleware(SQLDisplayMiddleware(sys.stdout))


if __name__ == '__main__':
#    from werkzeug import run_simple
#    run_simple('localhost', 7777, application, use_reloader=True, use_debugger=True)
    from www import models
    import sys
    import os

    def run_cherrypy_server(hostname=('h', ''), port=('p', 9999), threads=20,
            server_name='localhost', max=-1, request_queue_size=5, timeout=10):
        """run cherrypy server"""
        from accost import wsgiserver