-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fix template.render deprecation warnings for Django 1.9 #3654
Fix template.render deprecation warnings for Django 1.9 #3654
Conversation
context = RequestContext(renderer_context['request'], context) | ||
ret = template.render(context) | ||
else: | ||
ret = template.render(context, request=renderer_context['request']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go to the compat.py file and should be similar to the new API.
Thanks for fixing this. I think the code should be moved to compat.py and be given an API similar to Django's new one. |
Ok, I fix |
3bf5dfd
to
802ee5d
Compare
@xordoquy Done. |
Looks good - thanks! |
Fix template.render deprecation warnings for Django 1.9
We're trying to switch to Django 1.8 using django-jinja which expects to be passed a request to the render method. I was wondering if the condition whether to pass in the request could be modified in DRF to be checking for |
Indeed, this seems to have slip through. |
@jezdez thanks for the report ! |
Passing
RequestContext
toTemplate.render
is deprecated, see django/django#3883https://github.com/django/django/blob/1.9rc1/django/template/backends/django.py#L82-L84