Loader
is a class within the django.template.loaders.filesystem
module of the Django project.
django-markdown-view (PyPI package information) is a Django extension for serving Markdown files as Django templates. The project is open sourced under the BSD 3-Clause "New" or "Revised" license.
django-markdown-view / markdown_view / loaders.py
# loaders.py
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.template import Origin
from django.template.loaders.filesystem import Loader as FilesystemLoader
from django.template.utils import get_app_template_dirs
from django.utils._os import safe_join
from markdown_view.constants import DEFAULT_MARKDOWN_VIEW_LOADER_TEMPLATES_DIR
class MarkdownLoader(FilesystemLoader):
def get_dirs(self):
base_dir = getattr(
settings,
"MARKDOWN_VIEW_BASE_DIR",
getattr(
settings,
"BASE_DIR",
None)
)
dirs = [*get_app_template_dirs(
getattr(
settings,
"MARKDOWN_VIEW_LOADER_TEMPLATES_DIR",
DEFAULT_MARKDOWN_VIEW_LOADER_TEMPLATES_DIR
)
)]
## ... source file continues with no further Loader examples...