Skip to content

Commit 1bc003f

Browse files
committed
Switch from Django to Jinja2 templates in "data" plugin
1 parent 955098c commit 1bc003f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

config/plugins/sources/data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import logging
22

33
from django.db import models
4-
from django.template import Context, Template
4+
from django.template import Context
5+
from jinja2 import Template
56

67
from framarama.base import forms as base
78
from config.models import SourceStep
@@ -78,7 +79,7 @@ def run(self, model, data_in, ctx):
7879
if model.template_out:
7980
_template = Template(model.template_out)
8081
_data_out_dict = _data_out.get_as_dict()
81-
_output = _template.render(Context({'data': _data_out_dict.get() if _data_out_dict else {}}))
82+
_output = _template.render(data=_data_out_dict.get() if _data_out_dict else {})
8283

8384
_data_out = data.DataContainer(data=_output, data_type=data.DataType(data.DataType.MIME, model.mime_out))
8485

0 commit comments

Comments
 (0)