pyramid_zcml API

pyramid_zcml.load_zcml(spec='configure.zcml', features=())

Load configuration from a ZCML file into the current configuration state. The spec argument is an absolute filename, a relative filename, or a asset specification, defaulting to configure.zcml (relative to the package of the method's caller).

The features argument can be any iterable of strings. These are useful for conditionally including or excluding parts of a ZCML file.

pyramid_zcml.make_app(root_factory, package=None, filename='configure.zcml', settings=None)

Return a Router object, representing a fully configured Pyramid WSGI application.

Warning

Use of this function is deprecated as of Pyramid 1.0. You should instead use a pyramid.config.Configurator instance to perform startup configuration as shown in Application Configuration.

root_factory must be a callable that accepts a request object and which returns a traversal root object. The traversal root returned by the root factory is the default traversal root; it can be overridden on a per-view basis. root_factory may be None, in which case a 'default default' traversal root is used.

package is a Python package or module representing the application's package. It is optional, defaulting to None. package may be None. If package is None, the filename passed or the value in the options dictionary named configure_zcml must be a) absolute pathname to a ZCML file that represents the application's configuration or b) a asset specification to a ZCML file in the form dotted.package.name:relative/file/path.zcml.

filename is the filesystem path to a ZCML file (optionally relative to the package path) that should be parsed to create the application registry. It defaults to configure.zcml. It can also be a ;term:asset specification in the form dotted_package_name:relative/file/path.zcml. Note that if any value for configure_zcml is passed within the settings dictionary, the value passed as filename will be ignored, replaced with the configure_zcml value.

settings, if used, should be a dictionary containing runtime settings (e.g. the key/value pairs in an app section of a PasteDeploy file), with each key representing the option and the key's value representing the specific option value, e.g. {'reload_templates':True}. Note that the keyword parameter options is a backwards compatibility alias for the settings keyword parameter.

pyramid_zcml.includeme(config)

Function meant to be included via pyramid.config.Configurator.include(), which sets up the Configurator with a load_zcml method.