Modern Python Projects Transcripts
Chapter: Cookiecutter templates
Lecture: Tip on how I use cookiecutter
0:00 I want to give you a quick tip on how I use cookie cutter templates.
0:05 I've noticed that it's much easier to remove things from a project than to write everything
0:10 yourself. So what I usually do is I take a very popular cookie cutter template
0:15 and I generate a project with all the options enabled or disabled according to what I need. If I don't know how to configure something,
0:24 I leave the default value. And then once the project is generated, I go through all the features and I start removing what I'm not going to use
0:32 For example, in this Django project, let's see what we have. There are a lot of files,
0:39 but for example, if for some reason you are not going to use pytest you can remove pytest in it. If you're not going to use GitHub,
0:46 actions you can remove, GitHub actions folder, if by accident You selected Docker during the configuration, but you're not actually using docker.
0:56 You can remove all those doctor related files. dockerignore, the compose folder and so on.
1:03 And if you notice that you always remove the same parts of a cookie cutter template you might consider writing your own template.
1:10 That way you can customize what features your projects will have. So, let's talk about writing around templates in the next lesson.