Skip to content

Commit

Permalink
Disable Jinja2 template auto-reloading during production builds for i…
Browse files Browse the repository at this point in the history
…mproved performance (#1306)
  • Loading branch information
bartfeenstra authored Feb 22, 2024
1 parent e1c3d4e commit c10012c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions betty/jinja2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def __init__(self, app: App):
template_directory_paths = [str(path / 'templates') for path, _ in app.assets.paths]
super().__init__(
loader=FileSystemLoader(template_directory_paths),
auto_reload=app.project.configuration.debug,
enable_async=True,
undefined=DebugUndefined if app.project.configuration.debug else StrictUndefined,
autoescape=select_autoescape(['html.j2']),
Expand Down

0 comments on commit c10012c

Please sign in to comment.