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