Loading django/shortcuts/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ def render_to_response(*args, **kwargs): Returns a HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments. """ httpresponse_kwargs = {'mimetype': kwargs.pop('mimetype', None)} httpresponse_kwargs = {'content_type': kwargs.pop('mimetype', None)} return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) def render(request, *args, **kwargs): Loading django/views/csrf.py +1 −1 Original line number Diff line number Diff line Loading @@ -101,4 +101,4 @@ def csrf_failure(request, reason=""): 'reason': reason, 'no_referer': reason == REASON_NO_REFERER }) return HttpResponseForbidden(t.render(c), mimetype='text/html') return HttpResponseForbidden(t.render(c), content_type='text/html') django/views/debug.py +4 −4 Original line number Diff line number Diff line Loading @@ -63,10 +63,10 @@ def technical_500_response(request, exc_type, exc_value, tb): reporter = ExceptionReporter(request, exc_type, exc_value, tb) if request.is_ajax(): text = reporter.get_traceback_text() return HttpResponseServerError(text, mimetype='text/plain') return HttpResponseServerError(text, content_type='text/plain') else: html = reporter.get_traceback_html() return HttpResponseServerError(html, mimetype='text/html') return HttpResponseServerError(html, content_type='text/html') # Cache for the default exception reporter filter instance. default_exception_reporter_filter = None Loading Loading @@ -443,7 +443,7 @@ def technical_404_response(request, exception): 'request': request, 'settings': get_safe_settings(), }) return HttpResponseNotFound(t.render(c), mimetype='text/html') return HttpResponseNotFound(t.render(c), content_type='text/html') def empty_urlconf(request): "Create an empty URLconf 404 error response." Loading @@ -451,7 +451,7 @@ def empty_urlconf(request): c = Context({ 'project_name': settings.SETTINGS_MODULE.split('.')[0] }) return HttpResponse(t.render(c), mimetype='text/html') return HttpResponse(t.render(c), content_type='text/html') # # Templates are embedded in the file so that we know the error handler will Loading django/views/static.py +2 −2 Original line number Diff line number Diff line Loading @@ -58,9 +58,9 @@ def serve(request, path, document_root=None, show_indexes=False): mimetype = mimetype or 'application/octet-stream' if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'), statobj.st_mtime, statobj.st_size): return HttpResponseNotModified(mimetype=mimetype) return HttpResponseNotModified(content_type=mimetype) with open(fullpath, 'rb') as f: response = HttpResponse(f.read(), mimetype=mimetype) response = HttpResponse(f.read(), content_type=mimetype) response["Last-Modified"] = http_date(statobj.st_mtime) if stat.S_ISREG(statobj.st_mode): response["Content-Length"] = statobj.st_size Loading tests/regressiontests/test_client_regress/views.py +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ def return_json_file(request): cls=DjangoJSONEncoder, ensure_ascii=False) response = HttpResponse(obj_json.encode(charset), status=200, mimetype='application/json; charset=%s' % charset) content_type='application/json; charset=%s' % charset) response['Content-Disposition'] = 'attachment; filename=testfile.json' return response Loading Loading
django/shortcuts/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ def render_to_response(*args, **kwargs): Returns a HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments. """ httpresponse_kwargs = {'mimetype': kwargs.pop('mimetype', None)} httpresponse_kwargs = {'content_type': kwargs.pop('mimetype', None)} return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) def render(request, *args, **kwargs): Loading
django/views/csrf.py +1 −1 Original line number Diff line number Diff line Loading @@ -101,4 +101,4 @@ def csrf_failure(request, reason=""): 'reason': reason, 'no_referer': reason == REASON_NO_REFERER }) return HttpResponseForbidden(t.render(c), mimetype='text/html') return HttpResponseForbidden(t.render(c), content_type='text/html')
django/views/debug.py +4 −4 Original line number Diff line number Diff line Loading @@ -63,10 +63,10 @@ def technical_500_response(request, exc_type, exc_value, tb): reporter = ExceptionReporter(request, exc_type, exc_value, tb) if request.is_ajax(): text = reporter.get_traceback_text() return HttpResponseServerError(text, mimetype='text/plain') return HttpResponseServerError(text, content_type='text/plain') else: html = reporter.get_traceback_html() return HttpResponseServerError(html, mimetype='text/html') return HttpResponseServerError(html, content_type='text/html') # Cache for the default exception reporter filter instance. default_exception_reporter_filter = None Loading Loading @@ -443,7 +443,7 @@ def technical_404_response(request, exception): 'request': request, 'settings': get_safe_settings(), }) return HttpResponseNotFound(t.render(c), mimetype='text/html') return HttpResponseNotFound(t.render(c), content_type='text/html') def empty_urlconf(request): "Create an empty URLconf 404 error response." Loading @@ -451,7 +451,7 @@ def empty_urlconf(request): c = Context({ 'project_name': settings.SETTINGS_MODULE.split('.')[0] }) return HttpResponse(t.render(c), mimetype='text/html') return HttpResponse(t.render(c), content_type='text/html') # # Templates are embedded in the file so that we know the error handler will Loading
django/views/static.py +2 −2 Original line number Diff line number Diff line Loading @@ -58,9 +58,9 @@ def serve(request, path, document_root=None, show_indexes=False): mimetype = mimetype or 'application/octet-stream' if not was_modified_since(request.META.get('HTTP_IF_MODIFIED_SINCE'), statobj.st_mtime, statobj.st_size): return HttpResponseNotModified(mimetype=mimetype) return HttpResponseNotModified(content_type=mimetype) with open(fullpath, 'rb') as f: response = HttpResponse(f.read(), mimetype=mimetype) response = HttpResponse(f.read(), content_type=mimetype) response["Last-Modified"] = http_date(statobj.st_mtime) if stat.S_ISREG(statobj.st_mode): response["Content-Length"] = statobj.st_size Loading
tests/regressiontests/test_client_regress/views.py +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ def return_json_file(request): cls=DjangoJSONEncoder, ensure_ascii=False) response = HttpResponse(obj_json.encode(charset), status=200, mimetype='application/json; charset=%s' % charset) content_type='application/json; charset=%s' % charset) response['Content-Disposition'] = 'attachment; filename=testfile.json' return response Loading