Here you go, a fully working AJAX "Hello World" example in Django:
http://www.dajaxproject.com/dajaxice/ I use both Dajax and Dajaxice for a few projects of mine, check out my profile site for a fully working AJAX website made in Django: http://iamkevin.ca/ Django even has specific form widgets in 3rd party apps which use AJAX, such as django-selectable, see my full tutorial here: http://www.pythondiary.com/tutorials/add-ajax-powered-quick-search-any-django-site.html The thing is, when making an application, think about what the framework can do for you and look for solutions which work with the framework. Sure you can use "naked" jQuery, but why, when some developer devoted months of his/her time to build something that "just works". With Dajax for example, you can code almost 95% of your client-side script in Python. I use this for the "Contact" form on my personal profile page provided above. Django does all the form validation, and displays any errors to the user, all using AJAX, and almost no JavaScript coded by me. To take it a step further, you can use Pyjamas, which is Google Web toolkit(GWT) ported to Python. Most of the API is the same(according to the developers). I even wrote a short tutorial on how to integrate Pyjamas with Dajaxice for some nice Django AJAX goodness: http://www.pythondiary.com/tutorials/working-pyjamas-and-dajaxice.html Hopefully these resources help. Do it the Pythonic way! On Friday, 13 April 2012 02:08:19 UTC-5, Eli_West wrote: > > I've been attempting the most basic ajax call (.load() ) through > django for over a month now - each time trying a different method or > tutorial none with success. Can someone post a working paradigm for > whatever django csrf, firefox, ect. workaround they use? > > I can get jquery .load() to load content from an external file with > static files , no django. Same file served through django/templating > and the ajax is blocked. This is the general jquery call: > > $(document).ready(function() { > $('.list').click(function () { > $('#message').load('namesinfo.htm li'); > return false; > }); > }); > > To make things worse I found that Firefox/Chrome breaks Jquery's > sample 'Tabs: load content via ajax' in the Themroller download. But > it works in IE :/. Same .load() calls occuring here. Just working w > static files no django. Could it be related to Firefox/Chrome? > > I am pretty sure it is not: static file serving issues. I have heard > comments to follow django 'csrf / ajax' and included their sameOrgin > script to no avail. : > > https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ > > A similar issue even though this guys solution is hard to understand: > > > http://stackoverflow.com/questions/6643242/jquery-load-not-working-in-django > > > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/JAolJSG2LTUJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

