Abhinav Nair
Abhinav Nair

Reputation: 116

Dajaxice randomly stops working

So i have a Django project where I'm using Dajax and Dajaxice. The project runs well (being served locally using python manage.py runserver) but when I started it up again the next day (with no changes made to any files). The Dajaxice just stopped getting generated/parsed/served (I'm not sure what's wrong). This results in none of my Dajax methods in ajax.py getting called. Again, no settings or configuration or code was changed from a previously running instance of the project.

Here are the error messages various browsers show

Chrome

Resource interpreted as Script but transferred with MIME type application/octet-stream: "http://localhost:8000/modmap/static/dajaxice/dajaxice.core.js".

Firebug on Firefox

#onloading the html with dajaxice script
SyntaxError: syntax error
{% load url from future %}

#on trying to trigger a dajax function
ReferenceError: Dajaxice is not defined

Safari

#on loading page
SyntaxError: Unexpected token '%'

#on triggering method
ReferenceError: Can't find variable: Dajaxice

Interestingly enough, when I access the site through Chrome, whatever was working before the "disaster" works but if I write a new method in ajax.py and call it, it doesn't. I'm thinking that the new method doesn't get registered because the dajaxice.core.js script is not getting generated as it should each time. But on Firefox and Safari, none of the methods work. I also think that my static files are being served up fine because the dajax script gets loaded as it should.

I have read all the documentation and Q/A I could find but just can't seem to trace the source of my problem. I'd really appreciate if someone could point me in the right direction.

EDIT : collectstatic registered new functions too. Everything works on Chrome. Nothing works on Safari and Firefox. I'm starting to think this is a browser compatibility issue but I doubt myself when I think that without any change in the versions of anything, stuff used to seamlessly work on Safari and Firefox too.

Upvotes: 0

Views: 127

Answers (1)

Trix
Trix

Reputation: 597

Actually dajax and dajaxice are anymore improved so it is unwise to use them:

Should I use django-dajax or django-dajaxice?

In a word, No. I created these projects 4 years ago as a cool tool in order to solve one specific problems I had at that time.

These days using these projects is a bad idea. (...) If you want to use this project, you are probably wrong. You should stop couplig your interface with your backend or... in the long term it will explode in your face.

Upvotes: 1

Related Questions