This scheme seems to be working well so far.

One thing you may not have thought of is that switching 
to JinjaTemplateRenderer is incompatible with the admin because jinja2 
templates aren't provided for those widgets. I think the reasoning was that 
they're complicated to convert due to the use of the i18n and static 
template tags and (under the old rendering scheme) a DjangoTemplates 
backend had to be available anyway for rendering the main admin templates. 
So I think JinjaTemplateRenderer may not be that useful in practice as it 
requires your project and all its third-party apps to provide Jinja2 
templates for all widgets.

I used these steps to use Jinja2 and allow the admin to continue using 
DjangoTemplates:
1. Prepend this to the default settings.TEMPLATES:
 {
        'BACKEND': 'django.template.backends.jinja2.Jinja2',
        'APP_DIRS': True,
}
2. Add 'django.forms' to INSTALLED_APPS.
3. Add settings.FORM_RENDERER = 
'django.forms.renderers.templates.ProjectTemplateRenderer'

On Saturday, December 3, 2016 at 12:41:13 PM UTC-5, Preston Timmons wrote:
>
> Carl,
>
> The default renderer is backwards-compatible with no settings changes, 
>> and does not require Jinja2, but it still allows overrides/additions of 
>> widget templates. It's also standalone-compatible, in that it is 
>> self-contained and has no dependency on TEMPLATES config. 
>
>
> I like this idea. It's explicit and predictable. A lot simpler than our 
> current approach.
>
> Preston
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/6fd84f7b-3f8a-474d-bc9f-50919d21b5dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to