Configuring Flexx

This page lists the configuration options available to Flexx, implemented via the Config class. Configuration options are read from <appdata>/.flexx.cfg (check flexx.util.config.appdata_dir() for the actual location), and can also be set using environment variables and command line arguments, as explained below. Alternatively, options can be set directly in Python via = 3.


Configuration object for flexx

The options below can be set from different sources, and are evaluated in the following order:

  • From the default value.
  • From .cfg or .ini file, or a string in cfg format.
  • From environment variables, e.g. FLEXX_FOO=3.
  • From command-line arguments, e.g. --flexx-foo=3.
  • From setting the config option directly, e.g. = 3.

Use print(config) to get a summary of the current values and from which sources they were set.

  • browser_stacktrace (bool) – Show server stack traces in browser window (default True)
  • chrome_exe (str) – The location of the Chrome/Chromium executable. Auto-detect by default. (default ‘’)
  • cookie_secret (str) – The secret key to encode cookies. (default ‘flexx_secret’)
  • firefox_exe (str) – The location of the Firefox executable. Auto-detect by default. (default ‘’)
  • host_whitelist (str) – Comma separated list of allowed <host>:<port> values to pass cross-origin checks. (default ‘’)
  • hostname (str) – The default hostname to serve apps. (default ‘localhost’)
  • log_level (str) – The log level to use (DEBUG, INFO, WARNING, ERROR) (default ‘info’)
  • nw_exe (str) – The location of the NW.js executable. Auto-install by default. (default ‘’)
  • port (int) – The default port to serve apps. Zero means auto-select. (default 0)
  • ssl_certfile (str) – The cert file for https server. (default ‘’)
  • ssl_keyfile (str) – The key file for https server. (default ‘’)
  • tornado_debug (bool) – Setting the tornado application debug flag allows autoreload and other debugging features. (default ‘false’)
  • webruntime (str) – The default web runtime to use. Default is “app or browser”. (default ‘’)
  • ws_timeout (int) – If the websocket is idle for this amount of seconds, it is closed. (default 20)