---
title: "💭 API — Jinja Documentation"
description: "!https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.FileSystemLoader"
date: 2023-08-04
published: true
tags:
  - python
  - jinja
  - webdev
  - thought
template: link
---


![https://jinja.palletsprojects.com/en/3.0.x/api/<a href="/tags/jinja2/" class="hashtag-tag" data-tag="jinja2" data-count=1 data-reading-time=1 data-reading-time-text="1 minute">#jinja2</a>.FileSystemLoader](/static/https://jinja.palletsprojects.com/en/3.0.x/api/<a href="/tags/jinja2/" class="hashtag-tag" data-tag="jinja2" data-count=1 data-reading-time=1 data-reading-time-text="1 minute">#jinja2</a>.FileSystemLoader)

I've definitely been missing out on setting up a proper jinja loader on a few projects, I need to lean on this a bit more.

``` python
class jinja2.FileSystemLoader(searchpath, encoding='utf-8', followlinks=False):
    '''
    Load templates from a directory in the file system.
    '''
```
> The path can be relative or absolute. Relative paths are relative to the current working directory.

``` python
loader = FileSystemLoader("templates")
# A list of paths can be given. The directories will be searched in order, stopping at the first matching template.
loader = FileSystemLoader(["/override/templates", "/default/templates"])
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
