You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INSTALLED_APPS and other vars are setup as per doco.
A sample view page loads, and contains the JS in the , but the JS itself looks like this:
var Dajaxice = {
get_cookie: function(name)
{
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].toString().replace(/^\s+/, "").replace(/\s+$/, "");
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
i.e: no module or functions have been generated, thus the JS code doesn't exist to be called, to initiate an AJAX request.
I've inserted logging into my ajax.py, and it's definitely being loaded by auto discovery as part of urls.py.
I have tried to check that dajax is discovering my functions, however (and this may be my limited understanding of python) I cannot iterate the 'modules' properties of dajaxice_functions (it's NoneType) to check that the discovery added something into the dajax state. I get an exception:
for module in dajaxice_functions._modules:
logger.info("module: {0}".format(module))
TypeError: 'NoneType' object is not iterable
So either my python foo sucks (very possible) or discovery is in fact not registering that function.
I'm at a bit of a loss as to how to proceed. It looks close to working; but the lack of function discovery has me stumped. Any tips / pointers?
The text was updated successfully, but these errors were encountered:
I have a similar problem. My module functions are found in dajaxice.core.js when I run the development server, but when I collect static files they are not in there. I just get what you showed above. Do you also have them when you run dev server?
I have a similar problem. My module functions are found in dajaxice.core.js when I run the development server, but when I collect static files they are not in there. I just get what you showed above. Do you also have them when you run dev server?
—
Reply to this email directly or view it on GitHub.
I have been following the setup instructions here:
http://django-dajaxice.readthedocs.org/en/latest/installation.html
INSTALLED_APPS and other vars are setup as per doco.
A sample view page loads, and contains the JS in the , but the JS itself looks like this:
i.e: no module or functions have been generated, thus the JS code doesn't exist to be called, to initiate an AJAX request.
My ajax.py is:
I've inserted logging into my ajax.py, and it's definitely being loaded by auto discovery as part of urls.py.
I have tried to check that dajax is discovering my functions, however (and this may be my limited understanding of python) I cannot iterate the 'modules' properties of dajaxice_functions (it's NoneType) to check that the discovery added something into the dajax state. I get an exception:
So either my python foo sucks (very possible) or discovery is in fact not registering that function.
I'm at a bit of a loss as to how to proceed. It looks close to working; but the lack of function discovery has me stumped. Any tips / pointers?
The text was updated successfully, but these errors were encountered: