Glossary
- application registry
- A registry of configuration information consulted by Pyramid while
servicing an application. An application registry maps resource types
to views, as well as housing other application-specific component
registrations. Every Pyramid application has one (and only one)
application registry.
- asset
- Any file contained within a Python package which is not
a Python source code file.
- asset specification
- A colon-delimited identifier for an asset. The colon separates
a Python package name from a package subpath. For example, the
asset specification
my.package:static/baz.css
identifies the file
named baz.css
in the static
subdirectory of the my.package
Python package. See asset_specifications for more info.
- asset specification
- A colon-delimited identifier for an asset. The colon separates
a Python package name from a package subpath. For example, the
asset specification
my.package:static/baz.css
identifies the file
named baz.css
in the static
subdirectory of the my.package
Python package. See asset_specifications for more info.
- configuration declaration
- An individual method call made to an instance of a Pyramid
Configurator object which performs an arbitrary action, such as
registering a view configuration (via the
add_view
method of
the configurator) or route configuration (via the add_route
method of the configurator).
- configuration decoration
- Metadata implying one or more configuration declaration
invocations. Often set by configuration Python decorator
attributes, such as
pyramid.view.view_config
, aka
@view_config
.
- configurator
- An object used to do configuration declaration within an
application. The most common configurator is an instance of the
pyramid.config.Configurator
class.
- decorator
- A wrapper around a Python function or class which accepts the function
or class as its first argument and which returns an arbitrary object.
Pyramid provides several decorators, used for configuration and return
value modification purposes. See also PEP 318.
- dotted Python name
- A reference to a Python object by name using a string, in the form
path.to.modulename:attributename
. Often used in Paste and
setuptools configurations. A variant is used in dotted names within
configurator method arguments that name objects (such as the “add_view”
method’s “view” and “context” attributes): the colon (:
) is not
used; in its place is a dot.
- imperative configuration
- The configuration mode in which you use Python to call methods on
a Configurator in order to add each configuration
declaration required by your application.
- module
- A Python source file; a file on the filesystem that typically ends with
the extension
.py
or .pyc
. Modules often live in a
package.
- package
- A directory on disk which contains an
__init__.py
file, making
it recognizable to Python as a location which can be import
-ed.
A package exists to contain module files.
- Pylons
- A lightweight Python web framework.
- Pyramid
- A web framework.
- request
- A
WebOb
request object. See webob_chapter (narrative)
and request_module (API documentation) for information
about request objects.
- root factory
- The “root factory” of an Pyramid application is called
on every request sent to the application. The root factory
returns the traversal root of an application. It is
conventionally named
get_root
. An application may supply a
root factory to Pyramid during the construction of a
Configurator. If a root factory is not supplied, the
application uses a default root object. Use of the default root
object is useful in application which use URL dispatch for
all URL-to-view code mappings.
- route
- A single pattern matched by the url dispatch subsystem, which
generally resolves to one or more view callable objects. See
also url dispatch.
- route configuration
- Route configuration is the act of using imperative
configuration or a ZCML
<route>
statement to
associate request parameters with a particular route using
pattern matching and route predicate statements. See
urldispatch_chapter for more information about route
configuration.
- route predicate
- An argument to a route configuration which implies a value
that evaluates to
True
or False
for a given
request. All predicates attached to a route
configuration must evaluate to True
for the associated route
to “match” the current request. If a route does not match the
current request, the next route (in definition order) is
attempted.
- router
- The WSGI application created when you start a
Pyramid application. The router intercepts requests,
invokes traversal and/or URL dispatch, calls view functions, and
returns responses to the WSGI server on behalf of your
Pyramid application.
- scan
- The term used by Pyramid to define the process of
importing and examining all code in a Python package or module for
configuration decoration.
- traversal
- The act of descending “up” a tree of resource objects from a root
resource in order to find a context resource. The Pyramid
router performs traversal of resource objects when a root
factory is specified. See the traversal_chapter chapter for
more information. Traversal can be performed instead of URL
dispatch or can be combined with URL dispatch. See
hybrid_chapter for more information about combining traversal and
URL dispatch (advanced).
- URL dispatch
- An alternative to traversal as a mechanism for locating a a
view callable. When you use a route in your Pyramid
application via a route configuration, you are using URL
dispatch. See the urldispatch_chapter for more information.
- view
- Common vernacular for a view callable.
- view callable
- A “view callable” is a callable Python object which is associated with a
view configuration; it returns a response object . A
view callable accepts a single argument:
request
, which will be an
instance of a request object. A view callable is the primary
mechanism by which a developer writes user interface code within
Pyramid. See views_chapter for more information about Pyramid
view callables.
- view configuration
- View configuration is the act of associating a view callable
with configuration information. This configuration information helps
map a given request to a particular view callable and it can
influence the response of a view callable. Pyramid views can be
configured via imperative configuration, ZCML or by a
special
@view_config
decorator coupled with a scan. See
view_config_chapter for more information about view
configuration.
- View handler
- A view handler ties together
pyramid.config.Configurator.add_route()
and
pyramid.config.Configurator.add_view()
to make it more
convenient to register a collection of views as a single class when
using url dispatch. See also views_chapter.
- view predicate
- An argument to a view configuration which evaluates to
True
or False
for a given request. All predicates
attached to a view configuration must evaluate to true for the
associated view to be considered as a possible callable for a
given request.
- WSGI
- Web Server Gateway Interface. This is a
Python standard for connecting web applications to web servers,
similar to the concept of Java Servlets. Pyramid requires
that your application be served as a WSGI application.
- ZCML
- Zope Configuration Markup Language, an XML dialect
used by Zope and Pyramid for configuration tasks. ZCML
is capable of performing different types of configuration
declaration, but its primary purpose in Pyramid is to
perform view configuration and route configuration
within the
configure.zcml
file in a Pyramid
application. You can use ZCML as an alternative to
imperative configuration.
- ZCML declaration
- The concrete use of a ZCML directive within a ZCML file.
- ZCML directive
- A ZCML “tag” such as
<view>
, <route>
, or <handler>
.