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