On Sunday, 11 March 2018 21:06:51 UTC, Craig de Stigter wrote:
>
> Hi folks
>
> I'm upgrading a large app from 1.8 to 1.11 and coming up against this as I 
> traverse through django 1.9:
>
> >>> from django.template import engines, Context
> ... t = engines['django'].from_string('')
> ... t.render(Context({}))
> ...
> /path/to/bin/django-admin.py:3: RemovedInDjango110Warning: render() must 
> be called with a dict, not a Context.
>
>
> This is a surprising warning to me, since the docs still document the use 
> of Template.render(Context) in 2.0: 
> https://docs.djangoproject.com/en/2.0/ref/templates/api/#rendering-a-context
>
> Would someone mind explaining this?
>
> Cheers
> Craig de Stigter
>
>
>
Not the same thing. `t` here is an instance 
of django.template.backends.django.Template, whose render method takes a 
dict. If you did:

  from django.templates import Template
  t = Template('')

then you would have an instance of django.template.base.Template, whose 
render method takes a context.

I have no idea why the distinction, though.
-- 
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a6f7857a-a32e-4c13-8db7-e85bfcedad73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to