I know that the stream is quite old, but to answer it:
I found this:
http://dajaxproject.com/
example from the website:
ajax.py
from django.utils import simplejson from dajaxice.decorators import dajaxice_register @dajaxice_register def dajaxice_example(request): return simplejson.dumps({'message':'Hello from Python!'})
HTML
<input type="button" name="rand" value="Get message from server!" id="rand" onclick="Dajaxice.examples.dajaxice_example(my_callback)">
Javascript
function my_callback(data){ alert(data.message); }
I could not get it to work with "production standards" ...
The real magic of now.js is that you have JS on both sides and therefore there are no objects to convert to / (un) serialize
I was thinking of installing like this:
DJANGO β NODEJS β NOW β BROWSER
Django can send objects serialized as json to node, who will do the rest ...
I suppose that would be a little complicated ... I also thought about going the other way: it means getting all the nice features of django (models, (auto) admin, templates, URLs, middleware ...)
I could not find anything good like django (contrib) admin !! If anyone knows?
source share