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 toconfigure.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 beNone
, 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 toNone
.package
may beNone
. Ifpackage
isNone
, thefilename
passed or the value in theoptions
dictionary namedconfigure_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 formdotted.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 toconfigure.zcml
. It can also be a ;term:asset specification in the formdotted_package_name:relative/file/path.zcml
. Note that if any value forconfigure_zcml
is passed within thesettings
dictionary, the value passed asfilename
will be ignored, replaced with theconfigure_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 parameteroptions
is a backwards compatibility alias for thesettings
keyword parameter.
- pyramid_zcml.includeme(config)¶
Function meant to be included via
pyramid.config.Configurator.include()
, which sets up the Configurator with aload_zcml
method.