diff --git a/pyweb/djextdirect/__init__.py b/pyweb/djextdirect/__init__.py index c2eba36..830839d 100644 --- a/pyweb/djextdirect/__init__.py +++ b/pyweb/djextdirect/__init__.py @@ -15,7 +15,7 @@ * GNU General Public License for more details. """ -VERSION = ( 0, 8 ) +VERSION = ( 0, 9 ) VERSIONSTR = "v%d.%d" % VERSION diff --git a/pyweb/djextdirect/formprovider.py b/pyweb/djextdirect/formprovider.py index 05741d5..0c063d7 100644 --- a/pyweb/djextdirect/formprovider.py +++ b/pyweb/djextdirect/formprovider.py @@ -21,7 +21,7 @@ import functools from django import forms from django.http import HttpResponse, Http404 -from django.conf.urls.defaults import url +from django.conf.urls import url from django.utils.safestring import mark_safe from django.core.serializers.json import DjangoJSONEncoder diff --git a/pyweb/djextdirect/provider.py b/pyweb/djextdirect/provider.py index 452243a..e9d46de 100644 --- a/pyweb/djextdirect/provider.py +++ b/pyweb/djextdirect/provider.py @@ -23,7 +23,7 @@ from sys import stderr from django.http import HttpResponse from django.conf import settings -from django.conf.urls.defaults import patterns +from django.conf.urls import patterns from django.core.urlresolvers import reverse from django.utils.datastructures import MultiValueDictKeyError from django.core.serializers.json import DjangoJSONEncoder @@ -163,10 +163,10 @@ class Provider( object ): found) and encoding the response / exceptions. """ request.META["CSRF_COOKIE_USED"] = True - # First try to use request.POST, if that doesn't work check for req.raw_post_data. + # First try to use request.POST, if that doesn't work check for req.body. # The other way round this might make more sense because the case that uses - # raw_post_data is way more common, but accessing request.POST after raw_post_data - # causes issues with Django's test client while accessing raw_post_data after + # body is way more common, but accessing request.POST after body + # causes issues with Django's test client while accessing body after # request.POST does not. try: jsoninfo = { @@ -178,7 +178,7 @@ class Provider( object ): } except (MultiValueDictKeyError, KeyError), err: try: - rawjson = json.loads( request.raw_post_data ) + rawjson = json.loads( request.body ) except getattr( json, "JSONDecodeError", ValueError ): return HttpResponse( json.dumps({ 'type': 'exception',