Python for Entrepreneurs Transcripts
Chapter: Build web apps with Pyramid: Part 1
Lecture: Spectrum of frameworks
0:01 When deciding on a Python web framework, it's important to consider the tradeoffs that you make when you choose a particular framework.
0:08 So on one hand, we have a host or what are called micro frameworks, these frameworks are very lightweight
0:14 and they are great for building quick, simple applications, and then you bring many many pieces together to add on functionality.
0:21 Will that allow you to make exactly the app that you want because you've only brought in the pieces that you need,
0:27 it's actually a lot of work and it's a little bit hard for beginners because you don't know about all the little pieces you've got to put together.
0:33 On the other hand, we have what I am calling building block frameworks, maybe this is not quite the right term but what I mean is
0:39 these are the frameworks that have large pieces that you can stack together maybe you want to admin backend for your database, boom
0:46 here is a little piece you stick in there you want to data access layer right into the framework,
0:51 boom, there is your ORM, the way that you talk to your database, and so on. These are great, if that's what you want to use,
0:57 but if you don't want to use those, if you want to use a different kind of database, say a NoSQL database versus a relational one,
1:03 then all of the sudden these building blocks can be getting in your way and you have to work your way around them.
1:08 That's kind of the way I see the spectrum of the web frameworks, and in the building block area, we have Django.
1:14 one of the most popular web frameworks for Python and it has a lot of great building blocks, but like I said, has things like a built in ORM,
1:22 and if you don't want to access data in the way their ORM works,
1:24 or you are kind of fighting against the system a little bit, to go and do something different. On the other end we have frameworks like Bottle,
1:31 which are fast but very simple and don't come with very much functionality,
1:35 I would put Flask just up above Bottle in terms of what it brings to the table and how many little pieces you have to put together.
1:42 And then in the middle, what I would call the goldielocks range, not to small, not too big, would be Pyramid.
1:48 Pyramid is a framework that we are going to be using for this course, it's not as much of a building block thing as Django,
1:55 you can pick all the various pieces you want to use Mongo DB, no problem, use Mongo DB,
1:59 it's a little more full featured than some of the micro frameworks. So, let's take a look at Pyramid now.