Using and Mastering Cookiecutter Transcripts
Chapter: Case studies: Major projects using Cookiecutter
Lecture: Case study: Pyramid

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Next, let's look at the Pyramid web framework. So, Pyramid is one of the more popular web frameworks
0:07 it fits in there somewhere between Django and Flask, it's not quite as micro of a microframework as like Bottle or Flask
0:15 but it's not a big sort of building block thing that Django is. So, somewhere in the middle period. I like their little slogan here,
0:23 projects with ambition start small and finish big and have to stay finished, so I really love this framework,
0:28 it runs a lot of the Talk Python websites and web infrastructure so let's go look how we get started with Pyramid.
0:35 So, if I come over here I can say pcreate and pcreate is the tool, we just talked about having the API
0:43 in a tool or our game maker wrapping the API and this is kind of serving that purpose, it sort of uses a Cookiecutter but it didn't until recently
0:53 and I'm not sure if it actually uses Cookiecutter or if it's just the same files that come out but it's not really important as you'll see
1:00 so what we can do is we can counter a pcreate I want to use the scaffold starter
1:04 and let's call it first web app something like that something real simple and if we run this watch what happens
1:12 ok it looks like some the wrong there's a sorry at the end but it really, welcome to the Pyramid, sorry for the inconvenience
1:18 now let's go back to the top, bunch of stuff happened, but check this out
1:20 note, as of Pyramid 1.8, which basically just came out, this is actually deprecated this pcreate concept, instead you should be using cookiecutter
1:30 all right it shows you how to go look for all the cookiecutter things so we come over here and do a search, that search didn't go so well, did it?
1:38 Let's try again, here we go, so we have pyramid-cookiecutter-alchemy, pyramid-cookiecutter-starter and so on
1:44 so the thing I just created with a starter we can come over here and get this, now let's copy that, so we talked about the hooks
1:52 here are some things to do with hooks pre impose generation come down here to the repo, there's a template folder here
1:59 that has the various templates and notice we have Jinjja Mako and a .pt these are page similar or Chameleon temples
2:06 now originally this one shipped with just Jinja, but somebody here added Chamelon support and another guy that works on the project Mako support,
2:17 ok so these three got added and the tricks I showed you about using the hooks and modifying the files and so on
2:24 you can actually see those in here, about deleting non used files and what not so we can come down and achieve basically the same thing here,
2:34 we got our first web and Beeware, let's make a dir Pyramid and move first web into Pyramid okay so we come in here in cookiecutter, install this one
2:48 I've already installed it but I need to re-clone it because it now has to Mako support, yay!, so it's going to run Pyramid scaffold
2:56 and now it asks uses the choice template, let's say Chameleon that is the best; boom and then here is that little welcome message
3:03 welcome to the project, here's how you get started. Well the first thing I would do is I'd cd in here,
3:09 and then I'd run this and then I would run that etc. etc. Okay, so very cool project here,
3:15 and the fact that they're using Cookiecutter, they haven't been for long time, but they are moving to it, I think that's pretty interesting.


Talk Python's Mastodon Michael Kennedy's Mastodon