cyclone.bottle — Bottle application style

Support for Bootle application style.

http://bottlepy.com

For more information see the bottle demo: https://github.com/fiorix/cyclone/tree/master/demos/bottle

cyclone.bottle.route(path=None, method='GET', callback=None, **kwargs)[source]

Use this decorator to route requests to the handler.

Example:

@route("/")
def index(cli):
    cli.write("Hello, world")

@route("/foobar", method="post")
def whatever(cli):
    ...

Set method to “ANY” to have the route be called on method.:

@route("/foobar", method="any")
def all_routes(cli):
    ...
cyclone.bottle.create_app(**settings)[source]

Return an application which will serve the bottle-defined routes.

Parameters:

base_handler: The class or factory for request handlers. The default
is cyclone.web.RequestHandler.

more_handlers: A regular list of tuples containing regex -> handler

All other parameters are passed directly to the cyclone.web.Application constructor.

cyclone.bottle.run(**settings)[source]

Start the application.

Parameters:

host: Interface to listen on. [default: 0.0.0.0]

port: TCP port to listen on. [default: 8888]

log: The log file to use, the default is sys.stdout.

base_handler: The class or factory for request handlers. The default
is cyclone.web.RequestHandler.

more_handlers: A regular list of tuples containing regex -> handler

All other parameters are passed directly to the cyclone.web.Application constructor.

Previous topic

cyclone.locale — Internationalization support

Next topic

cyclone.sqlite — Inline SQLite

This Page