diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/shortcuts.py | 17 |
1 files changed, 0 insertions, 17 deletions
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 |
