bokeh.application.handlers.code — Anaconda Enterprise 4.4 documentation

Anaconda Enterprise: Documentation

# bokeh.application.handlers.code

Provide a Bokeh Application Handler to build up documents by compiling and executing Python source code.

This Handler is used by the Bokeh server command line tool to build applications that run off scripts and notebooks.

    def make_doc(doc):

        # do work to modify the document, add plots, widgets, etc.

        return doc

    app = Application(FunctionHandler(make_doc))

    server = Server({'/bkapp': app}, io_loop=IOLoop.current())

    server.start()

class `bokeh.application.handlers.code.` `CodeHandler`(*args, **kwargs)

  Run source code which modifies a Document

  `modify_document`(doc)
  `url_path`()

    The last path component for the basename of the configured filename.

  `error`

    If the handler fails, may contain a related error message.

  `error_detail`

    If the handler fails, may contain a traceback or other details.

  `failed`

    `True` if the handler failed to modify the doc

  `safe_to_fork`

    hether it is still safe for the Bokeh server to fork new workers.

    `False` if the code has already been executed.