Using and Mastering Cookiecutter Transcripts
Chapter: Sharing your Cookiecutter template with the world
Lecture: Step 1: Have a template

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Of course the first step with sharing your template is having a template,
0:04 so let me show you the template that I have created
0:06 crated both for some of my other courses or just for the community
0:09 and sort of spurred on to do it at this moment, for this particular course.
0:14 So if we look over in my Cookiecutters, there is a thing
0:17 I'm calling cookiecutter-pyramid-talk-python-starter
0:20 so Pyramid is a web framework, and they use Cookiecutter by default
0:24 they have three or four different starter templates,
0:26 and they all pretty basic, and so you start very close to the beginning of a project
0:31 it doesn't have a lot of integrated things and I wanted to create one
0:34 that came from my Python For Entrepreneurs course
0:37 that has many more integrations and is a much more well structured
0:40 in my opinion than what you start with,
0:43 so if we look here you can see I've got things
0:46 like view models and template organizations and I'm using a lot of stuff there.
0:51 I'm using Bower to manage the components rather than just point them off a CDNs,
0:54 we have a database integrated, we have MailChimp, we have Rollbar,
0:58 we have lots of cool stuff integrated,
1:00 so I want to use this template as the example here
1:02 so let's go in just run it to see what we get;
1:05 so I'll say cookiecutter and give it this, and I'm going to have
1:09 some kind of required name here, this will be a show off the web app
1:13 just to show you what's going on actually, let's do it like this
1:17 so we'll do it like this and of course we use a dependent property here
1:21 to generate a valid Python package name which is necessary
1:28 so we call this Talk Python the domain is
1:32 notice as a default
1:35 so that's really nice, description goes at the top of the pages
1:39 and then it ask you some questions about integration
1:42 so like there's no real way to say pause, show them something
1:46 so it's just going to be blanks as I press Enter,
1:48 so I'll just put a few things you can see where this goes,
1:50 it asks you what is your MailChimp API what's the key there
1:53 so if you have the key you can put this in and automatically
1:55 MailChimp will start working and this will be list 7,
1:58 if you have an outbound email server you can set that up
2:01 so this will be admin, and this is going to be root,
2:05 I'm just making up stuff right, the server is going to be localhost (
2:11 port take the default for encrypted, and Rollbar I'll just put some random stuff there
2:16 so now we have this template here, this thing is created by the template
2:21 so what we can do to get started, the way Pyramid works
2:26 is it works with package, it basically is a package
2:28 and you have to register it, so for that reason I'm going to go ahead
2:31 and create a virtual environment and set everything up here
2:34 so give me a second and I'll zoom ahead in the presentation
2:38 so I created the virtual environment, I activated it, now I just need to run the
2:43 to install everything, the dependencies as well as this package
2:49 okay, so everything is set up and registered and installed just fine
2:52 now we just need to run it, so we just run the server, say pserve
2:56 and give it the configuration file,
2:59 perfect no problems here, sometimes it says
3:02 the package that I just installed isn't found and I exit and log back in,
3:05 so let's go over here, load this up and see what we got
3:10 ok so this is what was generated by my package as the show off app up here,
3:14 you can see down here it has a MailChimp support
3:16 so I could put my email address and I could register
3:19 now it turns out that's not going to work because I didn't give it a real key
3:22 for MailChimp, but that's ok.
3:24 So we come to here we have a few things,
3:27 so notice this is the company name I put, this is the app name,
3:33 if I was actually to open it up, you would see that this is the package name
3:37 it's used throughout, let's look at one thing here, let's look at the development.any
3:43 so you can go through this and see that it's been configured
3:46 our SMTP settings we gave it are configured
3:49 this is configured, it looks like it might have a bug here
3:51 about the list id versus API key,
3:54 here's the Rollbar, everything that we need, right.
3:57 So this is great, this is a really good way to get started with this web app.
4:01 Now my goal is to share this template with the world
4:05 and get it listed on the Cookiecutter homepage.