<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gen_file_jinja(self, template_file, data, output, dest_path):
 if not os.path.exists(dest_path):
 os.makedirs(dest_path) output = join(dest_path, output) logger.debug("Generating: %s" % output) """ Fills data to the project template, using jinja2. """

        env = Environment()
        env.loader = FileSystemLoader(self.TEMPLATE_DIR)
        # TODO: undefined=StrictUndefined - this needs fixes in templates
        template = env.get_template(template_file)
        target_text = template.render(data)

        open(output, "w").write(target_text)
        return dirname(output), output