Hi everyone,

I have a django server, and a pyjamas client. I'm returning an HttpResponse
object with a mimetype of 'application/javascript'.

Firebug shows the response being received, but when I put...

Window.alert(response.onCompletion)

...in my browser code I get an empty string.

I thought this might be the same-origin policy, but everything is being
served from the Django test server, so it's all the same origin. Just to be
sure, I put in the...

        response['Access-Control-Allow-Origin'] = '*'
        response['Access-Control-Allow-Credentials'] = 'true'

...but they don't help. I've actually had the "same-origin policy" error
before (when working with GWT), and Firebug saw the response but not the
JSON. Firebug sees this JSON clearly, but pyjamas doesn't get it. Does
anyone know why that might be? Is there a certain field in the response
object that I should access explicitly?

I know I should be using the JSON-RPC with Django, and I may in time, but I
have a rather complex model hierarchy that I've never been able to
successfully and reliably serialize with the django serializer. This is why
I'm currently "rolling my own".

I'm using Python 2.7, the latest version of Pyjamas (pulled from git),
Windows 7 64-bit.

Kind regards,
Korey

Reply via email to