September 2017
Intermediate to advanced
206 pages
4h 34m
English
Pyramid is a web framework to build web applications based on Python. It's easier to use and to handle HTTP requests. You can install pyramid by typing this command:
$ pip install "pyramid==1.9.1"
It will install pyramid version 1.9.1. You can change it.
For testing, we'll build a simple web application to handle the / request. Use the following code:
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() print('server is running') server = ...Read now
Unlock full access