is there a Django library for AJAX support

134 views
Skip to first unread message

Krishnakant Mane

unread,
Jan 4, 2015, 8:15:26 AM1/4/15
to django...@googlegroups.com
Hello all,
I am realy impressed with the Django forms and some additional
enhancements with CrispyForms
<http://django-crispy-forms.readthedocs.org/en/latest/index.html>
Specially that additional library does a great job with css management
making it possible to make the forms look good and accessible using only
Python code.
Is there some thing similar for AJAX support?
I wish some thing like this.
Make a form using Crispy forms or even simple Django forms.
If a submit is required for sending an AJAX request and getting response
either in JSOn or otherwise, some Python code which exploites the
functionality of Jquery or any JS library is available.
The entire AJAX code is written using Python, just like the way css is
managed with the above mentioned library, so that one does not have to
go back to the template and write the javascript code, then come back to
the view to check the form for IDs of fields etc.
This moving back and forth for either css or javascript could be avoided
(Crispy forms already does it for css as I said before ).
Kindly let me know if such a thing exists.
Happy hacking.
Krishnakant.

Daniel França

unread,
Jan 5, 2015, 9:39:00 AM1/5/15
to django...@googlegroups.com
Have you tried Dajax/Dajaxice? http://www.dajaxproject.com/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54A93CCE.6070108%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Krishnakant Mane

unread,
Jan 5, 2015, 11:58:12 AM1/5/15
to django...@googlegroups.com
I see, it is a great library, yet I still have to write some javascript
code.
I was looking for some library wich let's say integrates with Jquery and
gives access to it's AJAX functionality through Python code, just like
crispy-forms does for CSS.
Happy hacking.
Krishnakant.
>> email to django-users...@googlegroups.com.

Martin Formanko

unread,
Jan 5, 2015, 6:11:43 PM1/5/15
to django...@googlegroups.com
In the past (2 years ago), when I used dajaxice, it was quite unstable and definitely not robust - it took some time after I understood how to react to different (erroneous) behavior. It would be better that time to code my own library, so that I could understand it more deeply in case of errors (I do not consider "something went wrong" as an explanatory error). It's just my experience, I am using it in 2 projects, it works, but it just took hours to get it fixed and working (incompatibility issues with datatables, debug-toolbar, quite serious performance problems in case of greater complexity). Anyways, it force you to keep your Ajax code organised in ajax.py. May be good or not.

Whether you use dajaxice or not, you do not need any JS in your form template file. Just override the submit handler with document.on('submit', '.ajaxified-form', ...)  in your main javascript file and thus make it generic for all "ajaxified" forms. You have to pass to this function POST URL as well somehow. Make also your forms in separate templates. 


To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/54A93CCE.6070108%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

Vijay Khemlani

unread,
Jan 5, 2015, 6:45:14 PM1/5/15
to django...@googlegroups.com
I don't think Python is the right tool for frontend development.

There are entire (and good) frameworks oriented to frontend using JavaScript (such as AngularJS), that also take care of DOM manipulation, handling events, encapsulating ajax requests, etc.

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages