The Pyramid Web Framework

Pyramid is a small, fast, down-to-earth Python web framework. It is developed as part of the Pylons Project. It is licensed under a BSD-like license.

Here is one of the simplest Pyramid applications you can make:

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('0.0.0.0', 6543, app)
    server.serve_forever()

After you install Pyramid and run this application, when you visit http://localhost:6543/ in a browser, you will see the text Hello World! See Creating Your First Pyramid Application for a full explanation of how this application works.

Getting Started

If you are new to Pyramid, we have a few resources that can help you get up to speed right away.

Tutorials

Official tutorials provide a quick overview of Pyramid's features in more depth than the Quick Tour and with working code, explain how to use Pyramid to build various types of applications, and how to deploy Pyramid applications to various platforms.

Support and Development

The Pyramid website is the main entry point to Pyramid web framework resources for support and development information.

To report bugs, use the issue tracker.

If you've got questions that aren't answered by this documentation, contact the Pylons-discuss maillist or join the #pyramid IRC channel.

Browse and check out tagged and trunk versions of Pyramid via the Pyramid GitHub repository. To check out the trunk via git, use either command:

# If you have SSH keys configured on GitHub:
git clone git@github.com:Pylons/pyramid.git

# Otherwise, HTTPS will work, using your GitHub login:
git clone https://github.com/Pylons/pyramid.git

To find out how to become a contributor to Pyramid, please see How to Contribute Source Code and Documentation.

Narrative Documentation

Narrative documentation in chapter form explaining how to use Pyramid.

API Documentation

Comprehensive reference material for every public API exposed by Pyramid:

p* Scripts Documentation

p* scripts included with Pyramid.

Change History

Design Documents

Typographical Conventions and Style Guide

Index and Glossary