Forums

Can't get dajax running

Hello,

I'm trying to get dajax up and running. I downloaded dajax and dajaxice from github using pip. I don't get any import error (placed the imports in my view.py for testing). Also I am able to import the libraries on the command. But can't call the my ajax.py functions. From my template I try to call a test function like this

<a href="#" onclick="Dajaxice.VsoilMap.hello(Dajax.process)">link</a>

The error I get:

TypeError: 'undefined' is not an object (evaluating 'Dajaxice.VsoilMap.hello')

The setup is exactly the same on my local machine where everything works fine. I'm kind of lost.

Could it be a problem with static files? Are you sure your javascript is being loaded correctly?

The rest of static files works fine. How could test if this specific file isn't loading correctly?

you can go to its url directly.... so, eg, larsvegas.pythonanywhere.com/static/js/dajax.js (or whatever it may be)

No, that's not it. I can access the file entering the URL directly. Any other idea?

@larsvegas -- interesting, that looks like a JavaScript error. Could you point me to a page that shows the problem?

Sorry for late reply. Here is a link to the project:

http://larsvegas.pythonanywhere.com/vsoilmap/mapper#

I will place a link called 'dajax' in the navigation menu and come back here regularly to see if you had the change to have a look. Thanks in advance.

VsoilMap in Dajaxice is not defined in any of the javascript that is loaded by http://larsvegas.pythonanywhere.com/vsoilmap/mapper#. Where is it defined on your local install?

My setup is exactly like it is described here: http://simonsstuffandthings.blogspot.nl/2012/05/installation-and-use-of-dajax-and.html

Does this help?

There are so many people out there having trouble getting dajax running...https://groups.google.com/forum/?fromgroups=#!forum/dajaxproject

Many of them obviously never resolved their issues. Wonder if I'll get lucky.

It looks to me like you're trying to run a Django 1.4+ app in our Django 1.3 environment and you've set the config so that only one of your Django apps is actually running (this is because of the folder structure change between 1.3 and 1.4). If you want to run Django 1.4+ on PythonAnywhere, you'll need to set up a virtualenv and run it from there. Here's a guide to doing that.

F#*k me. Can I buy you a beer by any chance?

Heh. A forum post like that is SO much better than a beer!

Do I hear some sarcasm;-)? Every right you have. But some magic happened in the meantime. Now it works. And I didn't do anything (but to offer you a beer)!

No. No sarcasm, at all. I really do love it when I can help you guys.

The account upgrade screen definitely needs a radio button to show prices in beer instead of currency. We could call it "Bitpints".

groan