So I’ve namespaces my templates in ISO22301/templates/ISO22301 and using the urls in views and templates works fine. However, if I try to use the name, I get Template Does Not exist errors.
Fore example, with the layout.html template:
urls.py
app_name="ISO22301"
urlpatterns = [
#path("landing/", views.landing, name="landing"),
path("layout/", views.layout, name="layout"),
path("leadership/", views.leadership, name="leadership"),
views.py
def layout(request):
return render(request, "layout",) # TemplateDoesNotExist - I expected this to work but my namespace may be the issue
return render(request, "ISO22301/layout.html",) # works
In addition, if I try to use the name in {% extends %} it doesn’t work either
{% extends "ISO22301/layout.html" %} # works
{% extends "layout" %} # TemplateDoesNotExist
{% extends url "layout" %} # Error is 'extends' takes one argument
{% extends url "ISO:22301:layout" %} # Error is 'extends' takes one argument
Is there a way to use namespaced name= values in extends? and render()?