Skip to content

Specify jinja FileSystemLoader path relative to running script #137

@william-aaron-CFA

Description

@william-aaron-CFA

The jinja environment FileSystemLoader specifies a file path for the jinja template directories. The following is an example of usage.

_JINJA_ENV = Environment(loader = FileSystemLoader('Template', followlinks = True))

However, this file path specification is dependent on the current working directory, which therefore requires us to run our scripts within the same directory containing the script. Instead, specify the template directory relative to the script itself, allowing us to run the script in any working directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions