Skip to content

Commit

Permalink
Merge pull request #126 from gitaarik/fix-usage-of-removed-django-code
Browse files Browse the repository at this point in the history
Update deprecated usage of code from Django
  • Loading branch information
jrief committed Dec 2, 2015
2 parents b869454 + aaad918 commit b4edf7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ws4redis/wsgi_server.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
import sys
import six
from six.moves import http_client
from redis import StrictRedis
import django
if django.VERSION[:2] >= (1, 7):
django.setup()
from django.conf import settings
from django.contrib.auth import get_user
from django.core.handlers.wsgi import WSGIRequest, logger, STATUS_CODE_TEXT
from django.core.handlers.wsgi import WSGIRequest, logger
from django.core.exceptions import PermissionDenied
from django import http
from django.utils.encoding import force_str
Expand Down Expand Up @@ -136,7 +137,7 @@ def __call__(self, environ, start_response):
websocket.close(code=1001, message='Websocket Closed')
else:
logger.warning('Starting late response on websocket')
status_text = STATUS_CODE_TEXT.get(response.status_code, 'UNKNOWN STATUS CODE')
status_text = http_client.responses.get(response.status_code, 'UNKNOWN STATUS CODE')
status = '{0} {1}'.format(response.status_code, status_text)
headers = response._headers.values()
if six.PY3:
Expand Down

0 comments on commit b4edf7c

Please sign in to comment.