Pyramid and MongoDB
Pyramid is an unopinionated web framework which resulted from the
merge of the repoz.bfg framework into
the Pylons umbrella project (not to be confused with Pylons 1.x, the web
framework). Pyramid can be considered to be a bit like a Pylons 2.0; it is
a clean break, a completely new codebase with no code-level backwards
compatibility with Pylons 1.x.
However, many of the concepts are very similar to the older Pylons 1.x. Pyramid is where all the new development is happening, and it has fantastic code test coverage and documentation. This section is only intended to be a brief introduction to setting up a Pyramid project with a MongoDB connection. To learn more, refer to the excellent Pyramid book and other resources available free online at http://docs.pylonsproject.org/.
On its own, Pyramid is just a framework, a set of libraries you can use. Projects are most easily started from a what is known as a scaffold. A scaffold is like a project skeleton which sets up plumbing and placeholders for your code.
A number of different scaffolds are included with Pyramid, offering
different persistence options, URL mappers and session implementations.
Conveniently enough, there is a scaffold called pyramid_mongodb which will build out a skeleton
project with MongoDB support for you. pyramid_mongodb eliminates the need for you to
worry about writing the glue code to make a MongoDB connection available
for request processing in Pyramid.
As with Pylons 1.x, to start using Pyramid ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access