I am using django-dajaxice, and after I tried the example, the file of dajaxice/dajaxice.core.js has loaded some functions from myapp/ajax.py

But the strange part is that, if I update this ajax.py in myapp folder, the js file is not updated with it, no matter I add a function or change the name of it, or delete any function in ajax.py.

The strange thing is that only sayhello works, ANY other function name doesn't work. Is it anything related with .pyc files? I deleted all the pyc files and got the same error.

Or in Python3, I shouldn't use dajaxice? But why sayhello works?

有帮助吗?

解决方案

I think I ended up touch-ing the __init__.py in the folder that contains ajax.py. That solved my issue.

Are you loading your function using the {% dajaxice_js %} (or similar) function, or are you loading it through some other method? The js is dynamically generated, which is loaded by the template.

Here's a useful link.

http://django-dajaxice.readthedocs.org/en/latest/quickstart.html#create-your-first-ajax-function

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top