From 9ded2189503b6ab973578efe8b01e54e69403a64 Mon Sep 17 00:00:00 2001 From: Reid Barton Date: Tue, 18 Aug 2015 18:41:11 -0700 Subject: [PATCH] Django 1.7 compatibility: miscellaneous changes (imported from commit 1f63d936c3d195acd033bb42fddacd240af3889b) --- zerver/lib/response.py | 2 +- zerver/management/commands/runtornado.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zerver/lib/response.py b/zerver/lib/response.py index 5fee1ed65a..b9a10163ff 100644 --- a/zerver/lib/response.py +++ b/zerver/lib/response.py @@ -27,7 +27,7 @@ def json_response(res_type="success", msg="", data={}, status=200): content = {"result": res_type, "msg": msg} content.update(data) return HttpResponse(content=ujson.dumps(content) + "\n", - mimetype='application/json', status=status) + content_type='application/json', status=status) def json_success(data={}): return json_response(data=data) diff --git a/zerver/management/commands/runtornado.py b/zerver/management/commands/runtornado.py index dccee63bf9..0623b625ed 100644 --- a/zerver/management/commands/runtornado.py +++ b/zerver/management/commands/runtornado.py @@ -144,7 +144,7 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler): def get(self): from tornado.wsgi import WSGIContainer - from django.core.handlers.wsgi import WSGIRequest + from django.core.handlers.wsgi import WSGIRequest, get_script_name import urllib environ = WSGIContainer.environ(self.request) @@ -152,7 +152,7 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler): request = WSGIRequest(environ) request._tornado_handler = self - set_script_prefix(base.get_script_name(environ)) + set_script_prefix(get_script_name(environ)) signals.request_started.send(sender=self.__class__) try: response = self.get_response(request)