4

I have seen few questions about the topic but all of them kinda old.

I just implemented my first dajaxice environment (developing using chrome) but I still get random "something goes wrong" with Firefox an IE. Indeed time to time also with Chrome.

I cannot figure out clearly the event, also because the not so explicative message: "something goes wrong". I did try to reproduce it but with no success.

So, are dajax/dajaxice still current? Or I better really focus on jQuery?

Are there indeed implicit browsers problems? (environment independent.. maybe)

What would be the browsers support for both cases?

mariotti
  • 410
  • 1
  • 5
  • 23
  • 1
    The dajax issue log looks sort of quiet. You might take a look at [jquery-taconite](http://jquery.malsup.com/taconite/). It may not give you everything you want, but it is incredibly easy to use -- just [Fire and Forget](http://en.wikipedia.org/wiki/Fire-and-forget). – Peter Rowell May 23 '12 at 01:42
  • Apparently part of my problem is the CSRF in dajax see https://github.com/jorgebastida/django-dajaxice/issues/30 – mariotti May 26 '12 at 10:31

1 Answers1

6

Your best bet is to use django-tastypie + backbone-tastypie. django-tastypie provides REST API access to your Django models and data, while backbone is a client-side javascript framework that makes interacting with your tastypie backend easy.

The downside to doing things this way is that there is a heavy learning curve.

More information here: http://readthedocs.org/docs/django-tastypie/en/latest/tools.html?highlight=backbone

I've got a projcet using dajaxice in production currently, and it gets significant user traffic. The downside to using Dajaxice is that it hasn't been maintained in a while. There are quite a few bugs (including performance issues) that make it difficult to use in any production system that gets real traffic. In my case, I see that even the simplest dajaxice views add a heavy 1000ms (1 second) performance penalty to almost any code I write.

NOTE: I emailed the maintainer of dajaxice, and he told me that he was planning on updating dajaxice later this year when he gets more free time. Hopefully this is the case.

The upside to using dajaxice is that the learning curve is low, and it helps keep your code clearly organized (eg: you put all your ajax into ajax.py, and you don't have to write much additional JS code).

My official recommendation is:

  • Use Dajaxice if this is a simple application that won't be seeing significant traffic, and performance doesn't really matter.
  • Use django-tastypie + backbone-tastypie if you're developing a serious application and need something reliable.
rdegges
  • 32,786
  • 20
  • 85
  • 109
  • Hoi @rdegges, I am not sure we are speaking about the same thing. I do not need to represent my data in a fancy way. I need to represent part of the data based on user interaction. I might be wrong, you tell me. But using tastypie I'll need to set up a 'resouce' at each user interaction. I think it is a bit too expensive. – mariotti May 25 '12 at 18:56
  • The part I have now (with bugs) works with google maps and reacts to zoom events. That is: the user zoom in and out, I give back whats within the zoom. It works... kinda. beside the actual question again. At present with dajaxice, but not without troubles.. – mariotti May 25 '12 at 19:00