Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-23 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Improving the docs sounds good. I think it would also be worth renaming engines to backends, and EngineHandler to BackendHandler, or similar. Yes it would require a deprecation cycle, but I also imagine 99% of projects would be unaffected. On Tue, Aug 23, 2022 at 8:39 PM Peter Thomassen wrote:

Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-23 Thread Peter Thomassen
Hi Carlton, On Mon, Aug 22, 2022 at 6:21 AM Carlton Gibson wrote: The current get_default() behaviour was only added to allow folks manually creating `Template("My String")` instances to continue to operate with multiple Django backends defined (#27359) — the initial assumption there was that

Re: Feature Request: get_default_backend() in django.template.Engine

2022-08-22 Thread Carlton Gibson
Hi Peter. I agree with you that the documentation isn't that clear here. *"Why are there two template classes?", "Why does one take a dict and the other a Context?"* — that comes up.  I don't think your suggestion itself it that unreasonable, but I'm wary about expanding the API here, at

Feature Request: get_default_backend() in django.template.Engine

2022-08-11 Thread Peter Thomassen
Hi, We're trying to create a template from string using DjangoTemplates.from_string() of the default template backend, which wraps the result of Engine.from_string() to construct an instance of the Template class defined in the backend definition file: django/template/backends/django.py#30