Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template loader alters path, can't find template again #77

Open
jbazik opened this issue Jul 26, 2021 · 0 comments
Open

Template loader alters path, can't find template again #77

jbazik opened this issue Jul 26, 2021 · 0 comments

Comments

@jbazik
Copy link

jbazik commented Jul 26, 2021

Multisite's template loader alters the template path and passes that along to the django template loader. This works great unless some other app decides to cache that path and start over. One such app is nephila/djangocms-blog, which does this:

        selected = select_template(templates)
        return selected.template.name

(https://github.com/nephila/djangocms-blog/blob/develop/djangocms_blog/cms_plugins.py)

Select_template finds and loads the template, so the name passed back is altered by multisite. So, for instance, "home.html" is transformed into "default/home.html" which the multisite loader cannot find.

A simple workaround is to add the django loader to the template loaders. However, multisite's docs suggest that's not necessary.

I think the problem is with multisite, since it is a reasonable expectation that template.name can be reused. But I don't have a simple suggestion for how to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant