Navigation

An access control entry. An access control entry is one element
in an ACL. An access control entry is a three-tuple that
describes three things: an action (one of either Allow or
Deny), a principal (a string describing a user or
group), and a permission. For example the ACE, (Allow,'bob','read') is a member of an ACL that indicates that the
principal bob is allowed the permission read against the
resource the ACL is attached to.

ACL

An access control list. An ACL is a sequence of ACE tuples.
An ACL is attached to a resource instance. An example of an ACL is [(Allow,'bob','read'),(Deny,'fred','write')]. If an ACL is
attached to a resource instance, and that resource is findable via the
context resource, it will be consulted any active security policy to
determine whether a particular request can be fulfilled given the
authentication information in the request.

Akhet is a
Pyramid library and demo application with a Pylons-like feel.
It's most known for its former application scaffold, which helped
users transition from Pylons and those preferring a more Pylons-like API.
The scaffold has been retired but the demo plays a similar role.

Alembic

Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.

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.

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 Understanding Asset Specifications for more
info.

authentication

The act of determining that the credentials a user presents
during a particular request are "good". Authentication in
Pyramid is performed via an authentication
policy.

authentication policy

An authentication policy in Pyramid terms is a bit of
code which has an API which determines the current
principal (or principals) associated with a request.

authorization

The act of determining whether a user can perform a specific action. In
pyramid terms, this means determining whether, for a given resource, any
principal (or principals) associated with the request have the
requisite permission to allow the request to continue.
Authorization in Pyramid is performed via its
authorization policy.

authorization policy

An authorization policy in Pyramid terms is a bit of
code which has an API which determines whether or not the
principals associated with the request can perform an action
associated with a permission, based on the information found on the
context resource.

Babel

A collection of tools for
internationalizing Python applications. Pyramid does not depend on
Babel to operate, but if Babel is installed, additional locale
functionality becomes available to your application.

cache busting

A technique used when serving a cacheable static asset in order to force
a client to query the new version of the asset. See Cache Busting
for more information.

Chameleon

chameleon is an
attribute language template compiler which supports the ZPT
templating specification. It is written and maintained by Malthe Borch. It
has several extensions, such as the ability to use bracketed (Mako-style)
${name} syntax. It is also much faster than the reference
implementation of ZPT. Pyramid offers Chameleon templating out of
the box in ZPT and text flavors.

Pyramid attempts to resolve ambiguous configuration statements made by
application developers via automatic conflict resolution. Automatic
conflict resolution is described in
Automatic Conflict Resolution. If Pyramid cannot resolve
ambiguous configuration statements, it is possible to manually resolve
them as described in Manually Resolving Conflicts.

console script

A script written to the bin (on Unix, or Scripts on Windows)
directory of a Python installation or virtual environment as the
result of running pipinstall or pipinstall-e..

context

A resource in the resource tree that is found during traversal
or URL dispatch based on URL data; if it's found via traversal,
it's usually a resource object that is part of a resource tree;
if it's found via URL dispatch, it's an object manufactured on
behalf of the route's "factory". A context resource becomes the subject
of a view, and often has security information attached to
it. See the Traversal chapter and the
URL Dispatch chapter for more information about how a URL
is resolved to a context resource.

A measurement of code coverage, usually expressed as a percentage of which lines of code have been executed over which lines are executable, typically run during test execution.

CPython

The C implementation of the Python language. This is the
reference implementation that most people refer to as simply
"Python"; Jython, Google's App Engine, and PyPy are examples of
non-C based Python implementations.

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.

A permission which is registered as the default for an
entire application. When a default permission is in effect,
every view configuration registered with the system will
be effectively amended with a permission argument that will
require that the executing user possess the default permission in
order to successfully execute the associated view
callable.

If an application does not register a root factory at Pyramid
configuration time, a default root factory is used to created the
default root object. Use of the default root object is useful in
application which use URL dispatch for all URL-to-view code
mappings, and does not (knowingly) use traversal otherwise.

Default view

The default view of a resource is the view invoked when the
view name is the empty string (''). This is the case when
traversal exhausts the path elements in the PATH_INFO of a
request before it returns a context resource.

Deployment settings

Deployment settings are settings passed to the Configurator as a
settings argument. These are later accessible via a
request.registry.settings dictionary in views or as
config.registry.settings in configuration code. Deployment settings
can be used as global application values.

Distribute is a fork of Setuptools which runs on both Python 2 and Python 3.
It is now in legacy state because Setuptools now runs on both Python 2 and 3.

distribution

(Setuptools/distutils terminology). A file representing an
installable library or application. Distributions are usually
files that have the suffix of .egg, .tar.gz, or .zip.
Distributions are the target of Setuptools-related commands such as
easy_install.

Persistent data related to your application. For example, data stored
in a relational database. In some applications, the resource
tree acts as the domain model.

dotted Python name

A reference to a Python object by name using a string, in the form
path.to.modulename:attributename. Often used in Pyramid 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.

entry point

A Setuptools indirection, defined within a Setuptools
distribution setup.py. It is usually a name which refers
to a function somewhere in a package which is held by the
distribution.

event

An object broadcast to zero or more subscriber callables
during normal Pyramid system operations during the
lifetime of an application. Application code can subscribe to
these events by using the subscriber functionality described in
Using Events.

In Python, the moment when a module is referred to in an import statement.
At this moment, all statements in that module at the module scope (at the left margin) are executed.
It is a bad design decision to put statements in a Python module that have side effects at import time.

interface

A Zope interface
object. In Pyramid, an interface may be attached to a
resource object or a request object in order to
identify that the object is "of a type". Interfaces are used
internally by Pyramid to perform view lookups and other
policy lookups. The ability to make use of an interface is
exposed to an application programmers during view
configuration via the context argument, the request_type
argument and the containment argument. Interfaces are also
exposed to application developers when they make use of the
event system. Fundamentally, Pyramid
programmers can think of an interface as something that they can
attach to an object that stamps it with a "type" unrelated to its
underlying Python type. Interfaces can also be used to describe
the behavior of an object (its methods and attributes), but
unless they choose to, Pyramid programmers do not need
to understand or use this feature of interfaces.

Internationalization

The act of creating software with a user interface that can
potentially be displayed in more than one language or cultural
context. Often shortened to "i18n" (because the word
"internationalization" is I, 18 letters, then N).

An object with the methods described by
pyramid.interfaces.IIntrospector that is available in both
configuration code (for registration) and at runtime (for querying) that
allows a developer to introspect configuration statements and
relationships between those statements.

An ordered sequence of objects based on a "location -aware"
resource. The lineage of any given resource is composed of
itself, its parent, its parent's parent, and so on. The order of the
sequence is resource-first, then the parent of the resource, then its
parent's parent, and so on. The parent of a resource in a lineage is
available as its __parent__ attribute.

Lingua

A package by Wichert Akkerman which provides the pot-create
command to extract translateable messages from Python sources
and Chameleon ZPT template files.

Locale Name

A string like en, en_US, de, or de_AT which
uniquely identifies a particular locale.

The process of displaying the user interface of an
internationalized application in a particular language or
cultural context. Often shortened to "l10n" (because the word
"localization" is L, 10 letters, then N).

Mako is a template language
which refines the familiar ideas of componentized layout and inheritance
using Python with Python scoping and calling semantics.

matchdict

The dictionary attached to the request object as
request.matchdict when a URL dispatch route has been matched.
Its keys are names as identified within the route pattern; its values are
the values matched by each pattern name.

media type

A label representing the type of some content.
A media type is a nested structure containing a top-level type and a subtype.
Optionally, a media type can also contain parameters specific to the type.
See RFC 6838 for more information about media types.

Middleware is a WSGI concept. It is a WSGI component
that acts both as a server and an application. Interesting uses
for middleware exist, such as caching, content-transport
encoding, and other functions. See WSGI documentation or PyPI to find middleware for your application.

mod_wsgi

mod_wsgi is an Apache
module developed by Graham Dumpleton. It allows WSGI applications
(such as applications developed using Pyramid) to be served using
the Apache web server.

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.

multidict

An ordered dictionary that can have multiple values for each key. Adds
the methods getall, getone, mixed, add and
dict_of_lists to the normal dictionary interface. See
Multidict and pyramid.interfaces.IMultiDict.

mutable

In Python, a value is mutable if it can be changed in place.
The Python list and dict types are mutable.
When a value is added to or removed from an instance of either, the original object remains.
The opposite of mutable is immutable.

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.

PasteDeploy

PasteDeploy is a library used by
Pyramid which makes it possible to configure
WSGI components together declaratively within an .ini
file. It was developed by Ian Bicking.

permission

A string or Unicode object that represents an action being taken against
a context resource. A permission is associated with a view name
and a resource type by the developer. Resources are decorated with
security declarations (e.g. an ACL), which reference these
tokens also. Permissions are used by the active security policy to
match the view permission against the resources's statements about which
permissions are granted to which principal in a context in order to
answer the question "is this user allowed to do this". Examples of
permissions: read, or view_blog_entries.

physical path

The path required by a traversal which resolve a resource starting
from the physical root. For example, the physical path of the
abc subobject of the physical root object is /abc. Physical paths
can also be specified as tuples where the first element is the empty
string (representing the root), and every other element is a Unicode
object, e.g. ('','abc'). Physical paths are also sometimes called
"traversal paths".

physical root

The object returned by the application root factory.
Unlike the virtual root of a request, it is not impacted by
Virtual Hosting: it will always be the actual object returned by
the root factory, never a subobject.

The PasteDeploy term for a single configuration of a WSGI
server, a WSGI application, with a set of middleware in-between.

pkg_resources

A module which ships with Setuptools and distribute that
provides an API for addressing "asset files" within a Python
package. Asset files are static files, template files, etc;
basically anything non-Python-source that lives in a Python package can
be considered a asset file.

plaster is
a library used by Pyramid which acts as an abstraction between
command-line scripts and the file format used to load the WSGI
components and application settings. By default Pyramid ships
with the plaster_pastedeploy library installed which provides
integrated support for loading a PasteDeploy INI file.

A principal is a string or Unicode object representing an entity,
typically a user or group. Principals are provided by an
authentication policy. For example, if a user has the
useridbob, and is a member of two groups named group foo and
group bar, then the request might have information attached to it
indicating that Bob was represented by three principals: bob, group
foo and group bar.

project

(Setuptools/distutils terminology). A directory on disk which
contains a setup.py file and one or more Python packages. The
setup.py file contains code that allows the package(s) to be
installed, distributed, and tested.

A package which logs Pyramid application exception (error) information
to a standard Python logger. This add-on is most useful when
used in production applications, because the logger can be configured to
log to a file, to Unix syslog, to the Windows Event Log, or even to
email. See its documentation.

Values injected as names into a renderer by a
pyramid.event.BeforeRender event.

Repoze

"Repoze" is essentially a "brand" of software developed by Agendaless
Consulting and a set of contributors. The
term has no special intrinsic meaning. The project's website has more information. The software developed
"under the brand" is available in a Subversion repository. Pyramid was originally known as
repoze.bfg.

An object which, provided a WSGI environment as a single
positional argument, returns a Pyramid-compatible request.

request type

An attribute of a request that allows for specialization
of view invocation based on arbitrary categorization. The every
request object that Pyramid generates and
manipulates has one or more interface objects attached to
it. The default interface attached to a request object is
pyramid.interfaces.IRequest.

resource

An object representing a node in the resource tree of an
application. If traversal is used, a resource is an element in
the resource tree traversed by the system. When traversal is used, a
resource becomes the context of a view. If url
dispatch is used, a single resource is generated for each request and
is used as the context resource of a view.

A plain text markup format
that is the defacto standard for documenting Python projects.
The Pyramid documentation is written in reStructuredText.

root

The object at which traversal begins when Pyramid
searches for a context resource (for URL Dispatch, the
root is always the context resource unless the traverse= argument
is used in route configuration).

root factory

The "root factory" of a 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 creates a default root object using the
default root factory.

Route configuration is the act of associating request parameters with a
particular route using pattern matching and route
predicate statements. See URL Dispatch 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.

Routes

A system by Ben Bangert
which parses URLs and compares them against a number of user defined
mappings. The URL pattern matching syntax in Pyramid is inspired by
the Routes syntax (which was inspired by Ruby On Rails pattern syntax).

routes mapper

An object which compares path information from a request to an
ordered set of route patterns. See URL Dispatch.

scaffold

A project template that generates some of the major parts of a Pyramid
application and helps users to quickly get started writing larger
applications. Scaffolds are usually used via the pcreate command.

Setuptools
builds on Python's distutils to provide easier building,
distribution, and installation of libraries and applications.

side effect

A statement or function has a side effect when it changes a value outside its own scope.
Put another way, if one can observe the change made by a function from outside that function, it has a side effect.

singleton

A singleton is a class which will only ever have one instance.
As there is only one, it is shared by all other code.
This makes it an example of global state.

SQLAlchemy is an object
relational mapper used in tutorials within this documentation.

subpath

A list of element "left over" after the router has
performed a successful traversal to a view. The subpath is a
sequence of strings, e.g. ['left','over','names']. Within
Pyramid applications that use URL dispatch rather than traversal, you
can use *subpath in the route pattern to influence the
subpath. See Using *subpath in a Route Pattern for more information.

A file with replaceable parts that is capable of representing some
text, XML, or HTML when rendered.

thread local

A thread-local variable is one which is essentially a global variable
in terms of how it is accessed and treated, however, each thread used by the
application may have a different value for this same "global" variable.
Pyramid uses a small number of thread local variables, as
described in Thread Locals.

A translation directory is a gettext translation
directory. It contains language folders, which themselves
contain LC_MESSAGES folders, which contain .mo files.
Each .mo file represents a set of translations for a language
in a translation domain. The name of the .mo file
(minus the .mo extension) is the translation domain name.

Translation Domain

A string representing the "context" in which a translation was
made. For example the word "java" might be translated
differently if the translation domain is "programming-languages"
than would be if the translation domain was "coffee". A
translation domain is represented by a collection of .mo files
within one or more translation directory directories.

Translation String

An instance of pyramid.i18n.TranslationString, which
is a class that behaves like a Unicode string, but has several
extra attributes such as domain, msgid, and mapping
for use during translation. Translation strings are usually
created by hand within software, but are sometimes created on the
behalf of the system for automatic template translation. For
more information, see Internationalization and Localization.

Translator

A callable which receives a translation string and returns a
translated Unicode object for the purposes of internationalization. A
localizer supplies a translator to a Pyramid application
accessible via its translate method.

traversal

The act of descending "up" a tree of resource objects from a root
resource in order to find a context resource. The
Pyramidrouter performs traversal of resource objects
when a root factory is specified. See the
Traversal chapter for more information. Traversal can be
performed instead of URL dispatch or can be combined with
URL dispatch. See Combining Traversal and URL Dispatch for more information about
combining traversal and URL dispatch (advanced).

truthy string

A string represeting a value of True. Acceptable values are
t, true, y, yes, on and 1.

tween

A bit of code that sits between the Pyramid router's main request
handling function and the upstream WSGI component that uses
Pyramid as its 'app'. The word "tween" is a contraction of
"between". A tween may be used by Pyramid framework extensions, to
provide, for example, Pyramid-specific view timing support, bookkeeping
code that examines exceptions before they are returned to the upstream
WSGI application, or a variety of other features. Tweens behave a bit
like WSGImiddleware but they have the benefit of running in a
context in which they have access to the Pyramid application
registry as well as the Pyramid rendering machinery. See
Registering Tweens.

A userid is a string or Unicode object used to identify and authenticate
a real-world user or client. A userid is supplied to an
authentication policy in order to discover the user's
principals. In the authentication policies which
Pyramid provides, the default behavior returns the user's userid as
a principal, but this is not strictly necessary in custom policies that
define their principals differently.

Venusian

Venusian is a library which
allows framework authors to defer decorator actions. Instead of
taking actions when a function (or class) decorator is executed
at import time, the action usually taken by the decorator is
deferred until a separate "scan" phase. Pyramid relies
on Venusian to provide a basis for its scan feature.

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. An
alternate calling convention allows a view to be defined as a
callable which accepts a pair of arguments: context and
request: this calling convention is useful for
traversal-based applications in which a context is always
very important. A view callable is the primary mechanism by
which a developer writes user interface code within
Pyramid. See Views 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, or by a special
@view_config decorator coupled with a scan. See
View Configuration for more information about view
configuration.

view deriver

A view deriver is a composable component of the view pipeline which is
used to create a view callable. A view deriver is a callable
implementing the pyramid.interfaces.IViewDeriver interface.
Examples of built-in derivers including view mapper, the permission
checker, and applying a renderer to a dictionary returned from the view.

A view mapper is a class which implements the
pyramid.interfaces.IViewMapperFactory interface, which performs
view argument and return value mapping. This is a plug point for
extension builders, not normally used by "civilians".

view name

The "URL name" of a view, e.g index.html. If a view is
configured without a name, its name is considered to be the empty
string (which implies the default view).

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.

virtual environment

An isolated Python environment that allows packages to be installed for
use by a particular application, rather than being installed system wide.

virtual root

A resource object representing the "virtual" root of a request; this is
typically the physical root object unless Virtual Hosting
is in use.

virtualenv

The virtualenv tool that allows
one to create virtual environments. In Python 3.3 and greater,
venv is the preferred tool.

Note: whenever you encounter commands prefixed with $VENV (Unix)
or %VENV (Windows), know that that is the environment variable whose
value is the root of the virtual environment in question.

WebTest is a package which can help you write functional tests for your WSGI application.

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.

The Zope Component Architecture (aka ZCA) is a system
which allows for application pluggability and complex dispatching
based on objects which implement an interface.
Pyramid uses the ZCA "under the hood" to perform view
dispatching and other application configuration tasks.