mirror of
https://github.com/django-components/django-components.git
synced 2025-09-14 09:55:00 +00:00
Added template loader for component templates automatic discovery (thanks @Real-Gecko)
This commit is contained in:
parent
74d7ea008b
commit
c1d090d5c0
2 changed files with 40 additions and 6 deletions
11
django_components/template_loader.py
Normal file
11
django_components/template_loader.py
Normal 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')
|
Loading…
Add table
Add a link
Reference in a new issue