Added template loader for component templates automatic discovery (thanks @Real-Gecko)

This commit is contained in:
Real-Gecko 2021-08-31 02:51:03 +06:00 committed by GitHub
parent 74d7ea008b
commit c1d090d5c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 6 deletions

View file

@ -0,0 +1,11 @@
"""
Template loader that loads templates from each Django app's "components" directory.
"""
from django.template.loaders.filesystem import Loader as FilesystemLoader
from django.template.utils import get_app_template_dirs
class Loader(FilesystemLoader):
def get_dirs(self):
return get_app_template_dirs('components')