- request
An object that represents an HTTP request, usually an instance of the
pyramid.request.Request
class. Seewebob_chapter
(narrative) andrequest_module
(API documentation) for information about request objects.- request factory
An object which, provided a
WSGI
environment as a single positional argument, returns a Pyramid-compatible request.- response factory
An object which, provided a
request
as a single positional argument, returns a Pyramid-compatible response. Seepyramid.interfaces.IResponseFactory
.- response
An object returned by a
view callable
that represents response data returned to the requesting user agent. It must implement thepyramid.interfaces.IResponse
interface. A response object is typically an instance of thepyramid.response.Response
class or a subclass such aspyramid.httpexceptions.HTTPFound
. Seewebob_chapter
for information about response objects.- response adapter
A callable which accepts an arbitrary object and "converts" it to a
pyramid.response.Response
object. Seeusing_iresponse
for more information.- 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
.- Setuptools
Setuptools builds on Python's
distutils
to provide easier building, distribution, and installation of libraries and applications.- pkg_resources
A module which ships with
Setuptools
that provides an API for addressing "asset files" within a Pythonpackage
. 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.- 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 Pythonpackage
name from a package subpath. For example, the asset specificationmy.package:static/baz.css
identifies the file namedbaz.css
in thestatic
subdirectory of themy.package
Pythonpackage
. Seeasset_specifications
for more info.- package
A directory on disk which contains an
__init__.py
file, making it recognizable to Python as a location which can beimport
-ed. A package exists to containmodule
files.- module
A Python source file; a file on the filesystem that typically ends with the extension
.py
or.pyc
. Modules often live in apackage
.- project
Setuptools / Python packaging terminology. A directory on disk which contains a
setup.py
and / orpyproject.toml
file and one or more Python packages. The project files contain metadata that allow the package(s) to be installed, distributed, and tested.- distribution
Setuptools / Python packaging terminology. A file representing an installable library or application. Distributions are usually archives that have the suffix of
.whl
,.tar.gz
, or.zip
. Distributions are the target of packaging-related commands such aspip install
.- entry point
A
Setuptools
indirection, defined within a Setuptoolsdistribution
(usually insetup.py
orsetup.cfg
). It is usually a name which refers to a function somewhere in a package which is held by the distribution.- 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.- 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 aresponse
object . A view callable accepts a single argument:request
, which will be an instance of arequest
object. An alternate calling convention allows a view to be defined as a callable which accepts a pair of arguments:context
andrequest
: this calling convention is useful for traversal-based applications in which acontext
is always very important. A view callable is the primary mechanism by which a developer writes user interface code withinPyramid
. Seeviews_chapter
for more information aboutPyramid
view callables.- view configuration
View configuration is the act of associating a
view callable
with configuration information. This configuration information helps map a givenrequest
to a particular view callable and it can influence the response of a view callable.Pyramid
views can be configured viaimperative configuration
, or by a special@view_config
decorator coupled with ascan
. Seeview_config_chapter
for more information about view configuration.- 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 thedefault view
).- Default view
The default view of a
resource
is the view invoked when theview name
is the empty string (''
). This is the case whentraversal
exhausts the path elements in the PATH_INFO of a request before it returns acontext
resource.- 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.- resource
An object representing a node in the
resource tree
of an application. Iftraversal
is used, a resource is an element in the resource tree traversed by the system. When traversal is used, a resource becomes thecontext
of aview
. IfURL dispatch
is used, a single resource is generated for each request and is used as the context resource of a view.- resource tree
A nested set of dictionary-like objects, each of which is a
resource
. The act oftraversal
uses the resource tree to find acontext
resource.- domain model
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.- traversal
The act of descending "up" a tree of resource objects from a root resource in order to find a
context
resource. ThePyramid
router
performs traversal of resource objects when aroot factory
is specified. See thetraversal_chapter
chapter for more information. Traversal can be performed instead ofURL dispatch
or can be combined with URL dispatch. Seehybrid_chapter
for more information about combining traversal and URL dispatch (advanced).- router
The
WSGI
application created when you start aPyramid
application. The router intercepts requests, invokes traversal and/or URL dispatch, calls view functions, and returns responses to the WSGI server on behalf of yourPyramid
application.- URL dispatch
An alternative to
traversal
as a mechanism for locating acontext
resource for aview
. When you use aroute
in yourPyramid
application via aroute configuration
, you are using URL dispatch. See theurldispatch_chapter
for more information.- context
A resource in the resource tree that is found during
traversal
orURL dispatch
based on URL data; if it's found via traversal, it's usually aresource
object that is part of a resource tree; if it's found viaURL dispatch
, it's an object manufactured on behalf of the route's "factory". A context resource becomes the subject of aview
, and often has security information attached to it. See thetraversal_chapter
chapter and theurldispatch_chapter
chapter for more information about how a URL is resolved to a context resource.- 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. EveryPyramid
application has one (and only one) application registry.- template
A file with replaceable parts that is capable of representing some text, XML, or HTML when rendered.
- location
The path to an object in a
resource tree
. Seelocation_aware
for more information about how to make a resource object location-aware.- permission
A string 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. anACL
), 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
, orview_blog_entries
.- default permission
A
permission
which is registered as the default for an entire application. When a default permission is in effect, everyview configuration
registered with the system will be effectively amended with apermission
argument that will require that the executing user possess the default permission in order to successfully execute the associatedview callable
.See also
setting_a_default_permission
.- ACE
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 eitherAllow
orDeny
), aprincipal
(a string describing a user or group), and apermission
. For example the ACE,(Allow, 'bob', 'read')
is a member of an ACL that indicates that the principalbob
is allowed the permissionread
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 theauthentication
information in the request.- authentication
The act of determining that the credentials a user presents during a particular request are "good". Authentication in
Pyramid
is performed via anauthentication policy
.- 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 requisitepermission
to allow the request to continue. Authorization inPyramid
is performed via itsauthorization policy
.- principal
A principal is a string representing an entity, typically a user or group. Principals are provided by an
authentication policy
. For example, if a user has theuserid
bob, 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.- userid
A userid is the string representation of an
identity
. Just like the identity, it should identify the user associated with the current request. Oftentimes this is the ID of the user object in a database.- identity
An identity is an object identifying the user associated with the current request. The object can be of any shape, such as a simple ID string or an ORM object.
- security policy
A security policy in
Pyramid
terms is an object implementing thepyramid.interfaces.ISecurityPolicy
API which identifies the user associated with the current request (perhaps via a cookie orAuthorization
header) and determines whether or not that user is permitted to access the requested resource.- 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 thecontext
resource.2.0 Authorization policies have been deprecated in favor of a
security policy
.- authentication policy
An authentication policy in
Pyramid
terms is a bit of code which has an API which determines the currentprincipal
(or principals) associated with a request.2.0 Authentication policies have been deprecated in favor of a
security policy
.- 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.- middleware
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.- pipeline
The
PasteDeploy
term for a single configuration of a WSGI server, a WSGI application, with a set ofmiddleware
in-between.- Zope
The Z Object Publishing Framework, a full-featured Python web framework.
- Grok
- Django
- Pylons
A lightweight Python web framework and a predecessor of Pyramid.
- ZODB
Zope Object Database, a persistent Python object store.
- WebOb
WebOb is a WSGI request/response library created by Ian Bicking.
- PasteDeploy
PasteDeploy is a library used by
Pyramid
which makes it possible to configureWSGI
components together declaratively within an.ini
file. It was developed by Ian Bicking.- plaster
plaster is a library used by
Pyramid
which acts as an abstraction between command-line scripts and the file format used to load theWSGI
components and application settings. By defaultPyramid
ships with theplaster_pastedeploy
library installed which provides integrated support for loading aPasteDeploy
INI file.- 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.- ZPT
The Zope Page Template templating language.
- METAL
Macro Expansion for TAL, a part of
ZPT
which makes it possible to share common look and feel between templates.- Genshi
An XML templating language by Christopher Lenz.
- Jinja2
A text templating language by Armin Ronacher.
- 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).- route
A single pattern matched by the
URL dispatch
subsystem, which generally resolves to aroot factory
(and then ultimately aview
).See also
URL dispatch
.- route configuration
Route configuration is the act of associating request parameters with a particular
route
using pattern matching androute predicate
statements. Seeurldispatch_chapter
for more information about route configuration.- Zope Component Architecture
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.- reStructuredText
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 whenPyramid
searches for acontext
resource (forURL Dispatch
, the root is always the context resource unless thetraverse=
argument is used in route configuration).- 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. Seestar_subpath
for more information.- interface
A Zope interface object. In
Pyramid
, an interface may be attached to aresource
object or arequest
object in order to identify that the object is "of a type". Interfaces are used internally byPyramid
to perform view lookups and other policy lookups. The ability to make use of an interface is exposed to an application programmers duringview configuration
via thecontext
argument, therequest_type
argument and thecontainment
argument. Interfaces are also exposed to application developers when they make use of theevent
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.- event
An object broadcast to zero or more
subscriber
callables during normalPyramid
system operations during the lifetime of an application. Application code can subscribe to these events by using the subscriber functionality described inevents_chapter
.- subscriber
A callable which receives an
event
. A callable becomes a subscriber viaimperative configuration
or viaconfiguration decoration
. Seeevents_chapter
for more information.- request type
An attribute of a
request
that allows for specialization of view invocation based on arbitrary categorization. The everyrequest
object thatPyramid
generates and manipulates has one or moreinterface
objects attached to it. The default interface attached to a request object ispyramid.interfaces.IRequest
.- repoze.lemonade
Zope2 CMF-like data structures and helper facilities for CA-and-ZODB-based applications useful within
Pyramid
applications.- repoze.catalog
An indexing and search facility (fielded and full-text) based on zope.index. See the documentation for more information.
- repoze.who
Authentication middleware for
WSGI
applications. It can be used byPyramid
to provide authentication information.- repoze.workflow
Barebones workflow for Python apps . It can be used by
Pyramid
to form a workflow system.- virtual root
A resource object representing the "virtual" root of a request; this is typically the
physical root
object unlessvhosting_chapter
is in use.- physical root
The object returned by the application
root factory
. Unlike thevirtual root
of a request, it is not impacted byvhosting_chapter
: it will always be the actual object returned by the root factory, never a subobject.- physical path
The path required by a traversal which resolve a
resource
starting from thephysical root
. For example, the physical path of theabc
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 string, e.g.('', 'abc')
. Physical paths are also sometimes called "traversal paths".- lineage
An ordered sequence of objects based on a "
location
-aware" resource. The lineage of any givenresource
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.- 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 namedget_root
. An application may supply a root factory toPyramid
during the construction of aConfigurator
. If a root factory is not supplied, the application creates a default root object using thedefault root factory
.- default root factory
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 useURL dispatch
for all URL-to-view code mappings, and does not (knowingly) use traversal otherwise.- SQLAlchemy
SQLAlchemy is an object relational mapper used in tutorials within this documentation.
- JSON
JavaScript Object Notation is a data serialization format.
- jQuery
A popular Javascript library.
- renderer
A serializer which converts non-
Response
return values from aview
into a string, and ultimately into a response, usually throughview configuration
. Using a renderer can make writing views that require templating or other serialization, like JSON, less tedious. Seeviews_which_use_a_renderer
for more information.- renderer factory
A factory which creates a
renderer
. Seeadding_and_overriding_renderers
for more information.- mod_wsgi
mod_wsgi is an Apache module developed by Graham Dumpleton. It allows
WSGI
applications (such as applications developed usingPyramid
) to be served using the Apache web server.- view predicate
An argument to a
view configuration
which evaluates toTrue
orFalse
for a givenrequest
. 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.- route predicate
An argument to a
route configuration
which implies a value that evaluates toTrue
orFalse
for a givenrequest
. All predicates attached to aroute configuration
must evaluate toTrue
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.- routes mapper
An object which compares path information from a request to an ordered set of route patterns. See
urldispatch_chapter
.- predicate
A test which returns
True
orFalse
. Two different types of predicates exist inPyramid
: aview predicate
and aroute predicate
. View predicates are attached toview configuration
and route predicates are attached toroute configuration
.- 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.
- configuration declaration
An individual method call made to a
configuration directive
, such as registering aview configuration
(via the~pyramid.config.Configurator.add_view
method of the configurator) orroute configuration
(via the~pyramid.config.Configurator.add_route
method of the configurator). A set of configuration declarations is also implied by theconfiguration decoration
detected by ascan
of code in a package.- configuration decoration
Metadata implying one or more
configuration declaration
invocations. Often set by configuration Pythondecorator
attributes, such aspyramid.view.view_config
, aka@view_config
.- scan
The term used by
Pyramid
to define the process of importing and examining all code in a Python package or module forconfiguration decoration
.- configurator
An object used to do
configuration declaration
within an application. The most common configurator is an instance of thepyramid.config.Configurator
class.- imperative configuration
The configuration mode in which you use Python to call methods on a
Configurator
in order to add eachconfiguration declaration
required by your application.- declarative configuration
The configuration mode in which you use the combination of
configuration decoration
and ascan
to configure your Pyramid application.- Not Found View
An
exception view
invoked byPyramid
when the developer explicitly raises apyramid.httpexceptions.HTTPNotFound
exception from withinview
code orroot factory
code, or when the current request doesn't match anyview configuration
.Pyramid
provides a default implementation of a Not Found View; it can be overridden. Seechanging_the_notfound_view
.- Forbidden view
An
exception view
invoked byPyramid
when the developer explicitly raises apyramid.httpexceptions.HTTPForbidden
exception from withinview
code orroot factory
code, or when theview configuration
andauthorization policy
found for a request disallows a particular view invocation.Pyramid
provides a default implementation of a forbidden view; it can be overridden. Seechanging_the_forbidden_view
.- Exception view
An exception view is a
view callable
which may be invoked byPyramid
when an exception is raised during request processing. Seeexception_views
for more information.- HTTP Exception
The set of exception classes defined in
pyramid.httpexceptions
. These can be used to generate responses with various status codes when raised or returned from aview callable
.See also
http_exceptions
.- 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 inthreadlocals_chapter
.See also the
stdlib documentation <threading.local>
for more information.- multidict
An ordered dictionary that can have multiple values for each key. Adds the methods
getall
,getone
,mixed
,add
anddict_of_lists
to the normal dictionary interface. Seemultidict_narr
andpyramid.interfaces.IMultiDict
.- PyPI
The Python Package Index, a collection of software available for Python.
- Agendaless Consulting
A consulting organization formed by Paul Everitt, Tres Seaver, and Chris McDonough.
See also Agendaless Consulting.
- Jython
A Python implementation written for the Java Virtual Machine.
- Python
The programming language in which
Pyramid
is written.- 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.- View Lookup
The act of finding and invoking the "best"
view callable
, given arequest
and acontext
resource.- Resource Location
The act of locating a
context
resource given arequest
.Traversal
andURL dispatch
are the resource location subsystems used byPyramid
.- Google App Engine
Google App Engine (aka "GAE") is a Python application hosting service offered by Google.
Pyramid
runs on GAE.- 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 atimport time
, the action usually taken by the decorator is deferred until a separate "scan" phase.Pyramid
relies on Venusian to provide a basis for itsscan
feature.- Translation String
An instance of
pyramid.i18n.TranslationString
, which is a class that behaves like a string, but has several extra attributes such asdomain
,msgid
, andmapping
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, seei18n_chapter
.- 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 moretranslation directory
directories.- Translation Context
A string representing the "context" in which a translation was made within a given
translation domain
. See the gettext documentation, 11.2.5 Using contexts for solving ambiguities for more information.- Translator
A callable which receives a
translation string
and returns a translated string for the purposes of internationalization. Alocalizer
supplies a translator to aPyramid
application accessible via its~pyramid.i18n.Localizer.translate
method.- Translation Directory
A translation directory is a
gettext
translation directory. It contains language folders, which themselves containLC_MESSAGES
folders, which contain.mo
files. Each.mo
file represents a set of translations for a language in atranslation domain
. The name of the.mo
file (minus the .mo extension) is the translation domain name.- Localizer
An instance of the class
pyramid.i18n.Localizer
which provides translation and pluralization services to an application. It is retrieved via thepyramid.i18n.get_localizer
function.- Locale Name
A string like
en
,en_US
,de
, orde_AT
which uniquely identifies a particular locale.- Default Locale Name
The
locale name
used by an application when no explicit locale name is set. Seelocalization_deployment_settings
.- Locale Negotiator
An object supplying a policy determining which
locale name
best represents a givenrequest
. It is used by thepyramid.i18n.get_locale_name
, andpyramid.i18n.negotiate_locale_name
functions, and indirectly bypyramid.i18n.get_localizer
. Thepyramid.i18n.default_locale_negotiator
function is an example of a locale negotiator.- Gettext
The GNU gettext library, used by the
Pyramid
translation machinery.- 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.- Lingua
A package by Wichert Akkerman which provides the
pot-create
command to extract translateable messages from Python sources and Chameleon ZPT template files.- Message Identifier
A string used as a translation lookup key during localization. The
msgid
argument to atranslation string
is a message identifier. Message identifiers are also present in amessage catalog
.- Message Catalog
A
gettext
.mo
file containing translations.- 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).
See also
Localization
.- Localization
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).
See also
Internationalization
.- renderer globals
Values injected as names into a renderer by a
pyramid.event.BeforeRender
event.- response callback
A user-defined callback executed by the
router
at a point after aresponse
object is successfully created.See also
using_response_callbacks
.- finished callback
A user-defined callback executed by the
router
unconditionally at the very end of request processing . Seeusing_finished_callbacks
.- pregenerator
A pregenerator is a function associated by a developer with a
route
. It is called by~pyramid.request.Request.route_url
in order to adjust the set of arguments passed to it by the user for special purposes. It will influence the URL returned by~pyramid.request.Request.route_url
. Seepyramid.interfaces.IRoutePregenerator
for more information.- session
A namespace that is valid for some period of continual activity that can be used to represent a user's interaction with a web application.
- session factory
A callable, which, when called with a single argument named
request
(arequest
object), returns asession
object. Seeusing_the_default_session_factory
,using_alternate_session_factories
andpyramid.config.Configurator.set_session_factory
for more information.- CSRF storage policy
A utility that implements
pyramid.interfaces.ICSRFStoragePolicy
which is responsible for allocating CSRF tokens to a user and verifying that a provided token is acceptable.- Mako
Mako is a template language which refines the familiar ideas of componentized layout and inheritance using Python with Python scoping and calling semantics.
- View handler
A view handler ties together
pyramid.config.Configurator.add_route
andpyramid.config.Configurator.add_view
to make it more convenient to register a collection of views as a single class when usingURL dispatch
. View handlers ship as part of thepyramid_handlers
add-on package.- Deployment settings
Deployment settings are settings passed to the
Configurator
as asettings
argument. These are later accessible via arequest.registry.settings
dictionary in views or asconfig.registry.settings
in configuration code. Deployment settings can be used as global application values.- WebTest
WebTest is a package which can help you write functional tests for your WSGI application.
- view mapper
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".- matchdict
The dictionary attached to the
request
object asrequest.matchdict
when aURL 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.- pyramid_zcml
An add-on package to
Pyramid
which allows applications to be configured viaZCML
. It is available onPyPI
. If you usepyramid_zcml
, you can use ZCML as an alternative toimperative configuration
orconfiguration decoration
.- ZCML
Zope Configuration Markup Language, an XML dialect used by Zope and
pyramid_zcml
for configuration tasks.- pyramid_handlers
An add-on package which allows
Pyramid
users to create classes that are analogues of Pylons 1 "controllers". See https://docs.pylonsproject.org/projects/pyramid_handlers/en/latest/.- pyramid_jinja2
Jinja2
templating system bindings for Pyramid, documented at https://docs.pylonsproject.org/projects/pyramid_jinja2/en/latest/. This package also includes a scaffold namedpyramid_jinja2_starter
, which creates an application package based on the Jinja2 templating system.- Akhet
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.
- Pyramid Community Cookbook
Additional, community-based documentation for Pyramid which presents topical, practical uses of Pyramid:
Pyramid Community Cookbook <cookbook:pyramid-cookbook>
- distutils
The standard system for packaging and distributing Python packages. See https://docs.python.org/2/distutils/index.html for more information.
Setuptools
is actually an extension of the Distutils.- exception response
A
response
that is generated as the result of a raised exception being caught by anexception view
.- PyPy
PyPy is an "alternative implementation of the Python language": http://pypy.org/
- 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 likeWSGI
middleware
but they have the benefit of running in a context in which they have access to the Pyramidapplication registry
as well as the Pyramid rendering machinery. Seeregistering_tweens
.- pyramid_debugtoolbar
A Pyramid add-on which displays a helpful debug toolbar "on top of" HTML pages rendered by your application, displaying request, routing, and database information.
pyramid_debugtoolbar
is configured into thedevelopment.ini
of all applications which use a Pyramidcookiecutter
. For more information, see https://docs.pylonsproject.org/projects/pyramid_debugtoolbar/en/latest/.- pyramid_exclog
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.
- console script
A script written to the
bin
(on Unix, orScripts
on Windows) directory of a Python installation orvirtual environment
as the result of runningpip install
orpip install -e .
.- introspector
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.- conflict resolution
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 inmanually_resolving_conflicts
.- configuration directive
A method of the
Configurator
which causes a configuration action to occur. The methodpyramid.config.Configurator.add_view
is a configuration directive, and application developers can add their own directives as necessary (seeadd_directive
).- action
Represents a pending configuration statement generated by a call to a
configuration directive
. The set of pending configuration actions are processed whenpyramid.config.Configurator.commit
is called.- discriminator
The unique identifier of an
action
.- introspectable
An object which implements the attributes and methods described in
pyramid.interfaces.IIntrospectable
. Introspectables are used by theintrospector
to display configuration information about a running Pyramid application. An introspectable is associated with aaction
by virtue of thepyramid.config.Configurator.action
method.- asset descriptor
An instance representing an
asset specification
provided by thepyramid.path.AssetResolver.resolve
method. It supports the methods and attributes documented inpyramid.interfaces.IAssetDescriptor
.- Waitress
A
WSGI
server that runs on Unix and Windows under Python 2.7+ and Python 3.3+. Projects generated via Pyramid cookiecutters use Waitress as a WGSI server. See https://docs.pylonsproject.org/projects/waitress/en/latest/ for detailed information.- gunicorn
Aka
gunicorn
, a fastWSGI
server that runs on Unix under Python 2.6+ or Python 3.4+. See https://gunicorn.org/ for detailed information.- predicate factory
A callable which is used by a third party during the registration of a route, view, or subscriber predicates to extend the configuration system. See
registering_custom_predicates
for more information.- add-on
A Python
distribution
that uses Pyramid's extensibility to plug into a Pyramid application and provide extra, configurable services.- pyramid_redis_sessions
A package by Eric Rasmussen which allows you to store Pyramid session data in a Redis database. See https://pypi.org/project/pyramid_redis_sessions/ for more information.
- 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.- 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 thepyramid.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.- truthy string
A string represeting a value of
True
. Acceptable values aret
,true
,y
,yes
,on
and1
.- falsey string
A string represeting a value of
False
. Acceptable values aref
,false
,n
,no
,off
and0
.- pip
The
Python Packaging Authority
's recommended tool for installing Python packages.- virtual environment
An isolated Python environment that allows packages to be installed for use by a particular application, rather than being installed system wide.
- venv
The
Python Packaging Authority
's recommended tool for creating virtual environments on Python 3.3 and greater.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.- Python Packaging Authority
The Python Packaging Authority (PyPA) is a working group that maintains many of the relevant projects in Python packaging.
- cookiecutter
A command-line utility that creates projects from cookiecutters (project templates), e.g., creating a Python package project from a Python package project template.
1.8 Added cookiecutter support.
1.10 Merged features from
pyramid-cookiecutter-alchemy
andpyramid-cookiecutter-zodb
into the single cookiecutter to rule them all,pyramid-cookiecutter-starter
.1.10
pyramid-cookiecutter-alchemy
andpyramid-cookiecutter-zodb
are no longer supported. Usepyramid-cookiecutter-starter
going forward.- coverage
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.
- execution policy
A policy which wraps the
router
by creating the request object and sending it through the request pipeline. Seepyramid.config.Configurator.set_execution_policy
.- 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
.Using a singleton is considered a poor design choice. As
mutable
global state, it can be changed by any other code, and so the values it represents cannot be reasoned about or tested properly.- global state
A set of values that are available to the entirety of a program.
- mutable
In Python, a value is mutable if it can be changed in place. The Python
list
anddict
types are mutable. When a value is added to or removed from an instance of either, the original object remains. The opposite of mutable isimmutable
.- immutable
In Python, a value is immutable if it cannot be changed. The Python
str
,int
, andtuple
data types are allimmutable
.- import time
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 haveside effect
s at import time.- 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.
- context manager
A context manager is an object that defines the runtime context to be established when executing a
with <python:with>
statement in Python. The context manager handles the entry into, and the exit from, the desired runtime context for the execution of the block of code. Context managers are normally invoked using thewith
statement, but can also be used by directly invoking their methods. Pyramid adds context managers forpyramid.config.Configurator
,pyramid.interfaces.IRouter.request_context
,pyramid.paster.bootstrap
,pyramid.scripting.prepare
, andpyramid.testing.testConfig
. See also the Python documentation forWith Statement Context Managers <python:context-managers>
and343
.- Alembic
Alembic is a lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python.
- 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
6838
for more information about media types.- route prefix
A route prefix is a path prefix that is prepended to any routes that are configured while it is active. A route prefix can be set via
pyramid.config.Configurator.include
orpyramid.config.Configurator.route_prefix_context
.- commit
An operation applied to a
configurator
. A commit checks for conflicts inconfiguration declaration
s, and if none are found applies all pendingaction
s. It is possible, although not necessarily recommended, to invokecommit
s usingpyramid.config.Configurator.commit
tomanually resolve <manually_resolving_conflicts>
configuration conflicts.- settings
Settings control the runtime behavior of a Pyramid application. They are the aggregation of configuration file declarations, process environment values, other additions generated by Pyramid or its add-ons and
tween
s, and values produced by your own code. Settings are collected at application startup. They can affect all the components which make up the the application. Pyramid itself, any tweens or Pyramid add-ons used, andyour own code may reference <deployment_settings>
and act on settings.- constructor
A function returning a Pyramid
WSGI
application. Every Pyramid application has a single constructor function namedmain
. It returns a Pyramidrouter
generated by aconfigurator
, and is written by you. The Pyramid constructor is the application'sentry point
.