Using and Mastering Cookiecutter Transcripts
Chapter: Creating Cookiecutter templates
Lecture: Concept: Extensions

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Jinja2 comes with the ability to write extensions for its template language,
0:04 here is the officially listed extensions as well as the API
0:08 that we can go to and write our own.
0:10 We could also go to GitHub and do searches for those extensions,
0:13 and we saw that there were 25 of those, at the time of the recording,
0:17 that is pretty cool, so if we want to use the extension,
0:20 we have to list it, right here in this _extensions.
0:24 Now, unfortunately, this must be an installed Python package,
0:28 which means pip install package-name typically depending on,
0:33 there is a few intricacies around which version of pip you're using
0:38 based on your path and so on, so this can get actually a little bit tricky
0:41 for your users and it's too bad that it doesn't somehow install
0:45 this kind of automatically, as part of the template creation,
0:49 so maybe there is some work to do, on this project to say look,
0:52 it requires these extensions if you either run this,
0:55 this command or I can do it for you, as part of the execution,
0:59 and we'll set this up in your user profile, so from now on
1:02 you can use these extensions there is a little bit of a security tightrope
1:06 to walk there but I think something like that would be really nice,
1:09 it doesn't exist now so if you're going to do this,
1:11 your users have to install jinja2-time before they could run this template.
1:15 But once we put this in here as an extension, then in our project,
1:18 we can say things like release date is {% now 'local' %}
1:24 And that comes from the time extension, so that's really cool.