Package turbogears :: Module startup

Module startup

source code

Things to do when the TurboGears server is started.

Functions
 
start_bonjour(package=None)
Register the TurboGears server with Apple's Bonjour framework.
source code
 
stop_bonjour()
Stop the Bonjour publishing daemon if it is running.
source code
 
start_turbogears()
Handles TurboGears tasks when the CherryPy server starts.
source code
 
stop_turbogears()
Handles TurboGears tasks when the CherryPy server stops.
source code
 
start_server(root)
Start the CherryPy Server.
source code
Variables
  call_on_startup = []
  call_on_shutdown = []
  webpath = ''
Function Details

start_bonjour(package=None)

source code 

Register the TurboGears server with Apple's Bonjour framework.

Currently only Unix-like systems are supported where either the 'avahi' daemon (Linux etc.) is available or the 'dns-sd' program (Mac OS X).

start_turbogears()

source code 
Handles TurboGears tasks when the CherryPy server starts.

This performs the following initialization tasks (in given order):

* Loads the template engines and the base templates.
* Turns off CherryPy access and error logging to screen since
  it disrupts with our own logging configuration. You can use
  the qualnames cherrypy.access and cherrypy.error for these messages.
* Adds a static tool for TurboGears's static files (URL '/tg_static').
* Adds a static tool for TurboGears's JavaScript files (URL '/tg_js').
* Adds a tool for decoding request parameters to Unicode.
* Adds a virtual path dispatcher if enabled in the configuration.
* Adds CherryPy tools and hooks for visit tracking, identity,
  database and decoding parameters into nested dictionaries.
* Registers the server with the Bonjour framework, if available.
* Calls 'turbogears.database.bind_metadata' when using SQLAlchemy.
* Loads all turbogears.extensions entry points and calls their
  'start_extension' method.
* Calls the callables registered in 'turbogears.call_on_startup'.
* Starts the TurboGears scheduler if enabled in the configuration.

stop_turbogears()

source code 

Handles TurboGears tasks when the CherryPy server stops.

Ends all open database transactions, shuts down all extensions, calls user provided shutdown functions and stops the scheduler.