Skip to main content

The Pyramid Web Framework, a Pylons project

Project description


1.10-branch CI Status 1.10-branch Documentation Status IRC Freenode

Pyramid is a small, fast, down-to-earth, open source Python web framework. It makes real-world web application development and deployment more fun, more predictable, and more productive.

from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response

def hello_world(request):
    return Response('Hello World!')

if __name__ == '__main__':
    with Configurator() as config:
        config.add_route('hello', '/')
        config.add_view(hello_world, route_name='hello')
        app = config.make_wsgi_app()
    server = make_server('', 6543, app)

Pyramid is a project of the Pylons Project.

Support and Documentation

See Pyramid Support and Development for documentation, reporting bugs, and getting support.

Developing and Contributing

See HACKING.txt and for guidelines on running tests, adding features, coding style, and updating documentation when developing in or contributing to Pyramid.


Pyramid is offered under the BSD-derived Repoze Public License.


Pyramid is made available by Agendaless Consulting and a team of contributors.

1.10.7 (2021-02-20)

1.10.6 (2021-02-20)

1.10.5 (2020-11-08)

  • Support Python 3.8 and 3.9.
  • Deprecate the default hashalg='md5' on pyramid.authentication.AuthTktCookieHelper to encourage users to be explicit if they want their code to work without changes when upgrading to Pyramid 2.0.

1.10.4 (2019-04-15)

1.10.3 (2019-04-12)

1.10.2 (2019-01-30)

  • Fix a bug in pyramid.testing.DummySecurityPolicy in which principals_allowed_by_permission would return all principals instead of an empty list if permissive is False. See
  • Fix a bug in which pyramid.exceptions.ConfigurationConflictError may not render the appropriate error message on certain conflicts that were not sortable on Python 3 due to differing types. See
  • Avoid configuring logging in the monitor process using the logging config intended for the application. This avoids opening files for writing in both processes which can cause issues on some systems. See

1.10.1 (2018-11-06)

  • Fix an issue when passing a duck-typed registry object into pyramid.testing.setUp(registry=...) in which the registry wasn’t properly fixed prior to invoking actions. See

1.10 (2018-10-31)

  • No major changes from 1.10b1.

1.10b1 (2018-10-28)

1.10a1 (2018-10-15)


Bug Fixes

  • Set appropriate code and title attributes on the HTTPClientError and HTTPServerError exception classes. This prevents inadvertently returning a 520 error code. See
  • Replace webob.acceptparse.MIMEAccept from WebOb with webob.acceptparse.create_accept_header in the HTTP exception handling code. The old MIMEAccept has been deprecated. The new methods follow the RFC’s more closely. See
  • Catch extra errors like AttributeError when unpickling “trusted” session cookies with bad pickle data in them. This would occur when sharing a secret between projects that shouldn’t actually share session cookies, like when reusing secrets between projects in development. See


  • The pyramid.intefaces.ISession interface will move to require JSON-serializable objects in Pyramid 2.0. See “Upcoming Changes to ISession in Pyramid 2.0” in the “Sessions” chapter of the documentation for more information about this change. See
  • The pyramid.session.signed_serialize and pyramid.session.signed_deserialize functions will be removed in Pyramid 2.0, along with the removal of pyramid.session.UnencryptedCookieSessionFactoryConfig which was deprecated in Pyramid 1.5. Please switch to using the SignedCookieSessionFactory, copying the code, or another session implementation if you’re still using these features. See
  • Media ranges are deprecated in the accept argument of pyramid.config.Configurator.add_route. Use a list of explicit media types to add_route to support multiple types.
  • Media ranges are deprecated in the accept argument of pyramid.config.Configurator.add_view. There is no replacement for ranges to add_view, but after much discussion the workflow is fundamentally ambiguous in the face of various client-supplied values for the Accept header. See

Backward Incompatibilities

  • On Python 3.4+ the repoze.lru dependency is dropped. If you were using this package directly in your apps you should make sure that you are depending on it directly within your project. See
  • Remove the permission argument from pyramid.config.Configurator.add_route. This was an argument left over from a feature removed in Pyramid 1.5 and has had no effect since then. See
  • Modify the builtin session implementations to set SameSite='Lax' on cookies. This affects pyramid.session.BaseCookieSessionFactory, pyramid.session.SignedCookieSessionFactory, and pyramid.session.UnencryptedCookieSessionFactoryConfig. See
  • Variables defined in the [pshell] section of the settings will no longer override those set by the setup function. See
  • pyramid.config.Configurator.add_notfound_view uses default redirect class exception pyramid.httpexceptions.HTTPTemporaryRedirect instead of previous pyramid.httpexceptions.HTTPFound. See
  • Removed pyramid.config.Configurator.set_request_property which had been deprecated since Pyramid 1.5. Instead use pyramid.config.Configurator.add_request_method with reify=True or property=True. See
  • Removed the principal keyword argument from which had been deprecated since Pyramid 1.6 and replaced by the userid argument. See
  • Removed the pyramid.tests subpackage that used to contain the Pyramid test suite. These changes also changed the format of the repository to move the code into a src folder. See

Documentation Changes

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyramid, version 1.10.7
Filename, size File type Python version Upload date Hashes
Filename, size pyramid-1.10.7-py2.py3-none-any.whl (327.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pyramid-1.10.7.tar.gz (2.7 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page