From 573ec714e5f52eccde01bbac3836d0edafcb2c20 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 27 Dec 2018 19:23:09 -0500 Subject: Refs #25978 -- Removed shortcuts.render_to_response() per deprecation timeline. --- django/shortcuts.py | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'django') diff --git a/django/shortcuts.py b/django/shortcuts.py index 7ab1df0e9d..eda6f8813c 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -3,31 +3,14 @@ This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ -import warnings - from django.http import ( Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect, ) from django.template import loader from django.urls import NoReverseMatch, reverse -from django.utils.deprecation import RemovedInDjango30Warning from django.utils.functional import Promise -def render_to_response(template_name, context=None, content_type=None, status=None, using=None): - """ - Return a HttpResponse whose content is filled with the result of calling - django.template.loader.render_to_string() with the passed arguments. - """ - warnings.warn( - 'render_to_response() is deprecated in favor of render(). It has the ' - 'same signature except that it also requires a request.', - RemovedInDjango30Warning, stacklevel=2, - ) - content = loader.render_to_string(template_name, context, using=using) - return HttpResponse(content, content_type, status) - - def render(request, template_name, context=None, content_type=None, status=None, using=None): """ Return a HttpResponse whose content is filled with the result of calling -- cgit v1.3