Working with view callables and view configurations

Our RESTful API won't be using the two modules included in the metrics/metrics/views subfolder that was generated by the app template. Thus, we must delete the metrics/metrics/views/default.py and metrics/metrics/views/notfound.py files.

Pyramid uses view callables as the main building blocks for a RESTful API. Whenever a request arrives, Pyramid finds and invokes the appropriate view callable to process the request and return an appropriate response.

View callables are callable Python objects such as functions, classes, or instances that implement a __call__ method. Any view callable receives an argument named request that will provide the pyramid.request.Request instance that represents ...

Get Hands-On RESTful Python Web Services - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.