Skip to content

Commit fbb0037

Browse files
committed
use string path to template
1 parent 0ff84ec commit fbb0037

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

src/django_idom/app_settings.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
from django.conf import settings
44

55

6-
APP_DIR = Path(__file__).parent
7-
8-
TEMPLATE_FILE_PATHS = {
9-
file.stem: str(file.absolute())
10-
for file in (APP_DIR / "templates" / "idom").iterdir()
11-
}
12-
136
IDOM_IGNORE_INSTALLED_APPS = set(getattr(settings, "IDOM_IGNORE_INSTALLED_APPS", []))
147

158
IDOM_BASE_URL = getattr(settings, "IDOM_BASE_URL", "_idom/")

src/django_idom/templates/idom/head_content.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/django_idom/templatetags/idom.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,15 @@
44

55
from django import template
66

7-
from django_idom.app_settings import (
8-
IDOM_WEB_MODULES_URL,
9-
IDOM_WEBSOCKET_URL,
10-
TEMPLATE_FILE_PATHS,
11-
)
7+
from django_idom.app_settings import IDOM_WEB_MODULES_URL, IDOM_WEBSOCKET_URL
128

139
from ..app_components import has_component
1410

1511

1612
register = template.Library()
1713

1814

19-
# Template tag that renders the IDOM scripts
20-
@register.inclusion_tag(TEMPLATE_FILE_PATHS["head_content"])
21-
def idom_head():
22-
pass
23-
24-
25-
@register.inclusion_tag(TEMPLATE_FILE_PATHS["view"])
15+
@register.inclusion_tag("idom/view.html")
2616
def idom_view(_component_id_, **kwargs):
2717
if not has_component(_component_id_):
2818
raise ValueError(f"No component {_component_id_!r} exists")

0 commit comments

Comments
 (0)