Provides the Bokeh Server Tornado application.
BokehTornado
A Tornado Application used to implement the Bokeh Server.
applications (dict[str,Application] or Application) –
A map from paths to Application instances.
Application
If the value is a single Application, then the following mapping is generated:
applications = { '/' : applications }
When a connection comes in to a given path, the associate Application is used to generate a new document for the session.
prefix (str, optional) – A URL prefix to use for all Bokeh server paths. (default: None)
extra_websocket_origins (list[str], optional) –
A list of hosts that can connect to the websocket.
This is typically required when embedding a Bokeh server app in an external web site using server_document() or similar.
server_document()
If None, ["localhost"] will be assumed (default: None)
["localhost"]
extra_patterns (seq[tuple], optional) –
A list of tuples of (str, http or websocket handler)
Use this argument to add additional endpoints to custom deployments of the Bokeh Server.
If None, then [] will be used. (default: None)
[]
secret_key (str, optional) –
A secret key for signing session IDs.
Defaults to the current value of the environment variable BOKEH_SECRET_KEY
BOKEH_SECRET_KEY
sign_sessions (bool, optional) –
Whether to cryptographically sign session IDs
Defaults to the current value of the environment variable BOKEH_SIGN_SESSIONS. If True, then secret_key must also be provided (either via environment setting or passed as a parameter value)
BOKEH_SIGN_SESSIONS
True
secret_key
generate_session_ids (bool, optional) – Whether to generate a session ID if one is not provided (default: True)
keep_alive_milliseconds (int, optional) –
Number of milliseconds between keep-alive pings (default: 37000)
Pings normally required to keep the websocket open. Set to 0 to disable pings.
check_unused_sessions_milliseconds (int, optional) – Number of milliseconds between checking for unused sessions (default: 17000)
unused_session_lifetime_milliseconds (int, optional) – Number of milliseconds for unused session lifetime (default: 15000)
stats_log_frequency_milliseconds (int, optional) – Number of milliseconds between logging stats (default: 15000)
mem_log_frequency_milliseconds (int, optional) –
Number of milliseconds between logging memory information (default: 0)
Enabling this feature requires the optional dependency psutil to be installed.
psutil
use_index (bool, optional) – Whether to generate an index of running apps in the RootHandler (default: True)
RootHandler
index (str, optional) – Path to a Jinja2 template to serve as the index for “/” if use_index is True. If None, the basic built in app index template is used. (default: None)
redirect_root (bool, optional) –
When there is only a single running application, whether to redirect requests to "/" to that application automatically (default: True)
"/"
If there are multiple Bokeh applications configured, this option has no effect.
websocket_max_message_size_bytes (int, optional) – Set the Tornado websocket_max_message_size value. (default: 20971520)
websocket_max_message_size
index – Path to a Jinja2 template to use for the root URL
auth_provider (AuthProvider, optional) – An AuthProvider instance
include_headers (list, optional) – List of request headers to include in session context (by default all headers are included)
exclude_headers (list, optional) – List of request headers to exclude in session context (by default all headers are included)
include_cookies (list, optional) – List of cookies to include in session context (by default all cookies are included)
exclude_cookies (list, optional) – List of cookies to exclude in session context (by default all cookies are included)
session_token_expiration (int, optional) – Duration in seconds that a new session token is valid for session creation. After the expiry time has elapsed, the token will not be able create a new session (default: 300)
Any additional keyword arguments are passed to tornado.web.Application.
tornado.web.Application
get_session
Get an active a session by name application path and session ID.
app_path (str) – The configured application path for the application to return a session for.
session_id (str) – The session ID of the session to retrieve.
ServerSession
get_sessions
Gets all currently active sessions for an application.
app_path (str) – The configured application path for the application to return sessions for.
list[ServerSession]
initialize
Start a Bokeh Server Tornado Application on a given Tornado IOLoop.
resources
Provide a Resources that specifies where Bokeh application sessions should load BokehJS resources from.
Resources
absolute_url (bool) – An absolute URL prefix to use for locating resources. If None, relative URLs are used (default: None)
start
Start the Bokeh Server application.
Starting the Bokeh Server Tornado application will run periodic callbacks for stats logging, cleanup, pinging, etc. Additionally, any startup hooks defined by the configured Bokeh applications will be run.
stop
Stop the Bokeh Server application.
wait (bool) – whether to wait for orderly cleanup (default: True)
None
app_paths
A list of all application paths for all Bokeh applications configured on this Bokeh server instance.
exclude_cookies
A list of request cookies to exclude in the session context.
exclude_headers
A list of request headers to exclude in the session context.
generate_session_ids
Whether this Bokeh Server Tornado Application has been configured to automatically generate session IDs.
include_cookies
A list of request cookies to make available in the session context.
include_headers
A list of request headers to make available in the session context.
index
Path to a Jinja2 template to serve as the index “/”
io_loop
The Tornado IOLoop that this Bokeh Server Tornado Application is running on.
prefix
A URL prefix for this Bokeh Server Tornado Application to use for all paths
A secret key for this Bokeh Server Tornado Application to use when signing session IDs, if configured.
session_token_expiration
Duration in seconds that a new session token is valid for session creation.
After the expiry time has elapsed, the token will not be able create a new session.
sign_sessions
Whether this Bokeh Server Tornado Application has been configured to cryptographically sign session IDs
If True, then secret_key must also have been configured.
websocket_origins
A list of websocket origins permitted to connect to this server.