Is there an infrastructure like now.js for Django?

I am looking for a framework that will allow me to simply update data in structures, rather than process queries and views every time.

I know it is better to use Node and express, but I have already tried and I feel that I can use Django better.

+4
source share
1 answer

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?

0
source

All Articles