Add Jinja2 support for export templates #3052
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Environment
Proposed Functionality
NetBox allows users to create arbitrary export templates for objects. Currently, these templates must be written in Django's native templating language. This request seeks to add Jinja2 as an alternate template language. While Jinja2 and Django's templating languae are very similar, Jinja2 has the advantages of being more flexible and more commonly understood.
Use Case
Jinja2 allows for more complex language within templates, whereas Django's template language is intentionally limited (with the design goal of pushing logic into the view component of Django's MVT framework).
Database Changes
Add a "template language" field to the ExportTemplate model. This will be set to Django for all existing templates but will default to Jinja2 for all new templates.
External Dependencies
Jinja2 is currently pulled in as a dependency by
drf-yasg
. It will be listed inrequirements.txt
as a top-level dependency but should not have any noticeable effect on existing installations.The text was updated successfully, but these errors were encountered: