commit | author | age
|
04bee5
|
1 |
===================== |
CM |
2 |
Author Introduction |
|
3 |
===================== |
9ec2d6
|
4 |
|
efcf8f
|
5 |
Welcome to "The :app:`Pyramid` Web Framework". In this |
04bee5
|
6 |
introduction, I'll describe the audience for this book, I'll describe |
CM |
7 |
the book content, I'll provide some context regarding the genesis of |
fd5ae9
|
8 |
:app:`Pyramid`, and I'll thank some important people. |
393a31
|
9 |
|
CM |
10 |
I hope you enjoy both this book and the software it documents. I've |
|
11 |
had a blast writing both. |
|
12 |
|
c5f24b
|
13 |
.. index:: |
CM |
14 |
single: book audience |
|
15 |
|
393a31
|
16 |
Audience |
04bee5
|
17 |
======== |
393a31
|
18 |
|
CM |
19 |
This book is aimed primarily at a reader that has the following |
|
20 |
attributes: |
|
21 |
|
|
22 |
- At least a moderate amount of :term:`Python` experience. |
|
23 |
|
|
24 |
- A familiarity with web protocols such as HTTP and CGI. |
|
25 |
|
|
26 |
If you fit into both of these categories, you're in the direct target |
|
27 |
audience for this book. But don't worry, even if you have no |
|
28 |
experience with Python or the web, both are easy to pick up "on the |
|
29 |
fly". |
|
30 |
|
|
31 |
Python is an *excellent* language in which to write applications; |
|
32 |
becoming productive in Python is almost mind-blowingly easy. If you |
|
33 |
already have experience in another language such as Java, Visual |
|
34 |
Basic, Perl, Ruby, or even C/C++, learning Python will be a snap; it |
|
35 |
should take you no longer than a couple of days to become modestly |
|
36 |
productive. If you don't have previous programming experience, it |
|
37 |
will be slightly harder, and it will take a little longer, but you'd |
|
38 |
be hard-pressed to find a better "first language." |
|
39 |
|
|
40 |
Web technology familiarity is assumed in various places within the |
223d4c
|
41 |
book. For example, the book doesn't try to define common web-related |
CM |
42 |
concepts like "URL" or "query string." Likewise, the book describes |
|
43 |
various interactions in terms of the HTTP protocol, but it does not |
|
44 |
describe how the HTTP protocol works in detail. Like any good web |
fd5ae9
|
45 |
framework, though, :app:`Pyramid` shields you from needing to know |
223d4c
|
46 |
most of the gory details of web protocols and low-level data |
CM |
47 |
structures. As a result, you can usually avoid becoming "blocked" |
|
48 |
while you read this book even if you don't yet deeply understand web |
|
49 |
technologies. |
9ec2d6
|
50 |
|
04bee5
|
51 |
.. index:: |
CM |
52 |
single: book content overview |
ee79c5
|
53 |
|
04bee5
|
54 |
Book Content |
CM |
55 |
============ |
|
56 |
|
d66e20
|
57 |
This book is divided into four major parts: |
SP |
58 |
|
|
59 |
:ref:`tutorials` |
|
60 |
|
|
61 |
Each tutorial builds a sample application or implements a set of |
|
62 |
concepts with a sample; it then describes the application or |
|
63 |
concepts in terms of the sample. You should read the tutorials if |
|
64 |
you want a guided tour of :app:`Pyramid`. |
04bee5
|
65 |
|
38b33d
|
66 |
:ref:`narrative_documentation` |
04bee5
|
67 |
|
fd5ae9
|
68 |
This is documentation which describes :app:`Pyramid` concepts in |
04bee5
|
69 |
narrative form, written in a largely conversational tone. Each |
CM |
70 |
narrative documentation chapter describes an isolated |
fd5ae9
|
71 |
:app:`Pyramid` concept. You should be able to get useful |
04bee5
|
72 |
information out of the narrative chapters if you read them |
CM |
73 |
out-of-order, or when you need only a reminder about a particular |
|
74 |
topic while you're developing an application. |
|
75 |
|
a70d54
|
76 |
:ref:`api_documentation` |
04bee5
|
77 |
|
38b33d
|
78 |
Comprehensive reference material for every public API exposed by |
fd5ae9
|
79 |
:app:`Pyramid`. The API documentation is organized |
38b33d
|
80 |
alphabetically by module name. |
CM |
81 |
|
d66e20
|
82 |
:ref:`pscripts_documentation` |
SP |
83 |
|
|
84 |
``p*`` scripts included with :app:`Pyramid`. |
|
85 |
|
3ea7c7
|
86 |
.. index:: |
CM |
87 |
single: repoze.zope2 |
|
88 |
single: Zope 3 |
|
89 |
single: Zope 2 |
c5f24b
|
90 |
single: repoze.bfg genesis |
edd915
|
91 |
single: pyramid genesis |
3ea7c7
|
92 |
|
9ec2d6
|
93 |
The Genesis of :mod:`repoze.bfg` |
04bee5
|
94 |
================================ |
edd915
|
95 |
|
fd5ae9
|
96 |
Before the end of 2010, :app:`Pyramid` was known as :mod:`repoze.bfg`. |
9ec2d6
|
97 |
|
CM |
98 |
I wrote :mod:`repoze.bfg` after many years of writing applications |
|
99 |
using :term:`Zope`. Zope provided me with a lot of mileage: it wasn't |
1de5ec
|
100 |
until almost a decade of successfully creating applications using it |
9ec2d6
|
101 |
that I decided to write a different web framework. Although |
CM |
102 |
:mod:`repoze.bfg` takes inspiration from a variety of web frameworks, |
393a31
|
103 |
it owes more of its core design to Zope than any other. |
9ec2d6
|
104 |
|
3ea7c7
|
105 |
The Repoze "brand" existed before :mod:`repoze.bfg` was created. One |
CM |
106 |
of the first packages developed as part of the Repoze brand was a |
|
107 |
package named :mod:`repoze.zope2`. This was a package that allowed |
|
108 |
Zope 2 applications to run under a :term:`WSGI` server without |
|
109 |
modification. Zope 2 did not have reasonable WSGI support at the |
|
110 |
time. |
9ec2d6
|
111 |
|
CM |
112 |
During the development of the :mod:`repoze.zope2` package, I found |
|
113 |
that replicating the Zope 2 "publisher" -- the machinery that maps |
|
114 |
URLs to code -- was time-consuming and fiddly. Zope 2 had evolved |
|
115 |
over many years, and emulating all of its edge cases was extremely |
|
116 |
difficult. I finished the :mod:`repoze.zope2` package, and it |
|
117 |
emulates the normal Zope 2 publisher pretty well. But during its |
|
118 |
development, it became clear that Zope 2 had simply begun to exceed my |
|
119 |
tolerance for complexity, and I began to look around for simpler |
|
120 |
options. |
|
121 |
|
f5106b
|
122 |
I considered using the Zope 3 application server machinery, but it |
9ec2d6
|
123 |
turned out that it had become more indirect than the Zope 2 machinery |
CM |
124 |
it aimed to replace, which didn't fulfill the goal of simplification. |
|
125 |
I also considered using Django and Pylons, but neither of those |
|
126 |
frameworks offer much along the axes of traversal, contextual |
|
127 |
declarative security, or application extensibility; these were |
|
128 |
features I had become accustomed to as a Zope developer. |
|
129 |
|
3ea7c7
|
130 |
I decided that in the long term, creating a simpler framework that |
CM |
131 |
retained features I had become accustomed to when developing Zope |
|
132 |
applications was a more reasonable idea than continuing to use any |
|
133 |
Zope publisher or living with the limitations and unfamiliarities of a |
fd5ae9
|
134 |
different framework. The result is what is now :app:`Pyramid`. |
9ec2d6
|
135 |
|
fd5ae9
|
136 |
The Genesis of :app:`Pyramid` |
edd915
|
137 |
============================= |
CM |
138 |
|
fd5ae9
|
139 |
What was :mod:`repoze.bfg` has become :app:`Pyramid` as the result of |
edd915
|
140 |
a coalition built between the :term:`Repoze` and :term:`Pylons` |
CM |
141 |
community throughout the year 2010. By merging technology, we're able |
|
142 |
to reduce duplication of effort, and take advantage of more of each |
|
143 |
others' technology. |
393a31
|
144 |
|
c5f24b
|
145 |
.. index:: |
CM |
146 |
single: Bicking, Ian |
|
147 |
single: Everitt, Paul |
|
148 |
single: Seaver, Tres |
|
149 |
single: Sawyers, Andrew |
|
150 |
single: Borch, Malthe |
|
151 |
single: de la Guardia, Carlos |
|
152 |
single: Brandl, Georg |
|
153 |
single: Oram, Simon |
|
154 |
single: Hardwick, Nat |
|
155 |
single: Fulton, Jim |
|
156 |
single: Moroz, Tom |
|
157 |
single: Koym, Todd |
|
158 |
single: van Rossum, Guido |
|
159 |
single: Peters, Tim |
37bcb7
|
160 |
single: Rossi, Chris |
2c0f82
|
161 |
single: Holth, Daniel |
CM |
162 |
single: Hathaway, Shane |
394c7b
|
163 |
single: Akkerman, Wichert |
dade3b
|
164 |
single: Laflamme, Blaise |
6bc4d5
|
165 |
single: Laflamme, Hugues |
dade3b
|
166 |
single: Bangert, Ben |
CM |
167 |
single: Duncan, Casey |
|
168 |
single: Orr, Mike |
1f4f96
|
169 |
single: Shipman, John |
895859
|
170 |
single: Beelby, Chris |
88f967
|
171 |
single: Paez, Patricio |
8c0344
|
172 |
single: Merickel, Michael |
c5f24b
|
173 |
|
9ec2d6
|
174 |
Thanks |
04bee5
|
175 |
====== |
9ec2d6
|
176 |
|
e4ed8f
|
177 |
This book is dedicated to my grandmother, who gave me my first |
CM |
178 |
typewriter (a Royal), and my mother, who bought me my first computer |
|
179 |
(a VIC-20). |
9ec2d6
|
180 |
|
CM |
181 |
Thanks to the following people for providing expertise, resources, and |
|
182 |
software. Without the help of these folks, neither this book nor the |
dade3b
|
183 |
software which it details would exist: Paul Everitt, Tres Seaver, Andrew |
CM |
184 |
Sawyers, Malthe Borch, Carlos de la Guardia, Chris Rossi, Shane Hathaway, |
|
185 |
Daniel Holth, Wichert Akkerman, Georg Brandl, Blaise Laflamme, Ben Bangert, |
88f967
|
186 |
Casey Duncan, Hugues Laflamme, Mike Orr, John Shipman, Chris Beelby, Patricio |
8c0344
|
187 |
Paez, Simon Oram, Nat Hardwick, Ian Bicking, Jim Fulton, Michael Merickel, |
CM |
188 |
Tom Moroz of the Open Society Institute, and Todd Koym of Environmental |
|
189 |
Health Sciences. |
9ec2d6
|
190 |
|
c81116
|
191 |
Thanks to Guido van Rossum and Tim Peters for Python. |
9ec2d6
|
192 |
|
c81116
|
193 |
Special thanks to Tricia for putting up with me. |