top | item 5466343

(no title)

pmouzo | 13 years ago

Not a single mention of AJAX.

discuss

order

dmoney|13 years ago

Writing the server side of an AJAXy search was pretty straightforward. In your view function, Instead of rendering a template, you call json.dumps() (or the equivalent in XML), and set the content type of the HTTP response (i think "application/json"). Django won't generate your client side JavaScript for you (nor should it IMO), so use jQuery or whatever you want.

iends|13 years ago

Why is this an issue with an article about writing effective django?

gojomo|13 years ago

Many web apps/services now use at least a little AJAX. Certain things in a framework can make it easier. Some discussion of how AJAX techniques, up through 'single-page apps', can use a DJango back-end would be nice. (Maybe not absolutely necessary... but nice.)

nkuttler|13 years ago

AJAX is nothing more than sending and receiving data from the server to the client. That's what views do, and they are documented.

There is also an is_ajax() test in Django (not that useful) and various apps that provide REST interfaces that you'd probably want to use for bigger AJAX-y apps.

devniel|13 years ago

you can use Django-rest-framework ,it's good.