Edit me on GitHub

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 %(name)s!' % request.matchdict)

if __name__ == '__main__':
    config = Configurator()
    config.add_route('hello', '/hello/{name}')
    config.add_view(hello_world, route_name='hello')
    app = config.make_wsgi_app()
    server = make_server('0.0.0.0', 8080, app)
    server.serve_forever()
   

After you install Pyramid and run this application, when you visit http://localhost:8080/hello/world 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. Read the Narrative Documentation to understand how Pyramid is designed to scale from simple applications like this to very large web applications. To just dive in headfirst, read the Quick Tour of Pyramid.

Getting Started

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

Narrative Documentation

Narrative documentation in chapter form explaining how to use Pyramid.

Design Documents

Support and Development

The Pylons Project web site is the main online source of Pyramid 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 this command:

git clone git@github.com:Pylons/pyramid.git

To find out how to become a contributor to Pyramid, please see the contributor's section of the documentation.

Index and Glossary