I am writing a management command for Django and I created template files that I parse to create new files.
So far to do that I used Jinja2 but since it is a Django management commands, I would like to switch to django based template.
Do you know how I can set up the template environnement in a django management command file ?
What I am looking for is the equivalent of this jinja2 code :
env = Environment(loader=PackageLoader('modulo.bin', 'templates/plugin_templates'))
EDIT: Ok in management commands it will work. But what if I want to use django-template in a normal python script ?
Thanks,
Rémy
You don’t need to set up any environment. You’re in a Django command, you can use Django templates.