Understanding Kotti’s startup phase¶
- When a Kotti application is started the
kotti.main()
function is called by the WSGI server and is passed asettings
dictionary that contains all key / value pairs from the[app:kotti]
section of the*.ini
file. - The
settings
dictionary is passed tokotti.base_configure()
. This is where the main work happens:- Every key in kotti.conf_defaults that is not in the
settings
dictionary (i.e. that is not in the.ini
file) is copied to thesettings
dictionary, together with the default value for that key. - Add-on initializations: all functions that are listed in the
kotti.configurators
parameter are resolved and called. pyramid.includes
are removed from thesettings
dictionary for later processing, i.e. afterkotti.base_includes
.- A class:pyramid.config.Configurator is instanciated with the remaining
settings
. - The
kotti.base_includes
(containing various Kotti subsystems, such askotti.events
,kotti.views
, etc.) are passed toconfig.include
. - The
pyramid.includes
that were removed from thesettings
dictionary in step 2.3 are processed. - The
kotti.zcml_includes
are processed.
- Every key in kotti.conf_defaults that is not in the
- The SQLAlchemy engine is created with the connection URL that is defined
in the sqlalchemy.url parameter in the
.ini
file. - The fully configured WSGI application is returned to the WSGI server and is ready to process requests.