Giter Site home page Giter Site logo

Comments (20)

andrejtokarcik avatar andrejtokarcik commented on July 20, 2024

One would have thought that the DAJAXICE_DEBUG setting looks promising, though it doesn't really hold for its description. To achieve such an effect, and thus to find out more information on what's going under the hood, you need to put logging.basicConfig(level=logging.DEBUG) (or even the ERROR level should suffice for those "Something goes wrong" alerts) in somewhere, your settings file, say.

from django-dajaxice.

jorgebastida avatar jorgebastida commented on July 20, 2024

@andrejtokarcik Thanks for the response :D

@johngilbrough Have you found the error?

from django-dajaxice.

johngilbrough avatar johngilbrough commented on July 20, 2024

@jorgebastida Up until now I have simply commented out the //alert('Something goes wrong:', data); in dajaxice.core.js, after finding that data always contains nothing. Everything is still working.

How can I change the logging for just djajaxice to find out what causing these errors?

from django-dajaxice.

johngilbrough avatar johngilbrough commented on July 20, 2024

Now I know what "Close" means :)

from django-dajaxice.

Ender27182818 avatar Ender27182818 commented on July 20, 2024

I'm having the same problem. I'm getting a 403 error when POSTing to the URL for my function

POST /dajaxice/MySite.myexample/ HTTP/1.1 403

from django-dajaxice.

Ender27182818 avatar Ender27182818 commented on July 20, 2024

Whoa, strangely, insanely, it works from Chromium but not Firefox.

from django-dajaxice.

Ender27182818 avatar Ender27182818 commented on July 20, 2024

Okay, looking in to it farther it has to do with the fact that Chromium is sending an X-CSRFToken in its header, and Firefox is not. The error firefox is getting back has to do with lack of CSRF validation. This is likely because I have authentication enabled on my site but not set up entirely properly.

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

I am having a similar problem. Have you found a solution yet? This page works fine for me in Chromium, but I get the error in FF6 when you make a selection. http://www.dajaxproject.com/forms/

from django-dajaxice.

Ender27182818 avatar Ender27182818 commented on July 20, 2024

My solution was to dump Ajaxice. That wasn't my first choice, but after playing around for a while the problem appeared to be something that I couldn't easily fix, and since I wasn't using ajaxice much, it was easy to take out.

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

@Ender27182818 have you switched to something else, or doing things more manually? @jorgebastida unfortunately, it seems that none of the demos on http://www.dajaxproject.com/ no longer work with FireFox, at least with FF6. I have also tested with Chromium 6.x, and it seems to work. This is going to be a pile of rework on my part if this can't be fixed. :-(

from django-dajaxice.

Ender27182818 avatar Ender27182818 commented on July 20, 2024

I'm doing things more manually now - I found that I wasn't using dajaxice as much as I thought, and a little bit of url.py/javascript glue was all that I needed to get the same functions working

from django-dajaxice.

jorgebastida avatar jorgebastida commented on July 20, 2024

@bmeyer71 atm http://www.dajaxproject.com/forms/ is working for me using FF 6.0.2. I've also used Chrome 13 and works in the same way.

You've the "Something went wrong" message true? Is your CSRF correctly configured? What version of dajaxice do you have? 0.2 ? Have you already followed this instructions http://docs.dajaxproject.com/dajaxice/csrftoken-issues.html?

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

@jorgebastida that's strange. I get the "Something goes wrong" alert when I try changing the country from the drop down in FF 6.0.2, but it works fine in Chromium.

As for my own project, currently I am getting that alert message when I run Dajaxice.the_projects.clearsearch(Dajax.process); and it doesn't matter what I have in that function for code.
Am I calling it wrong?

Oddly enough, this works, so far: onchange="Dajaxice.the_projects.citytown(Dajax.process,{'option':this.value})"
Yes, I have both the load statement and that js import statement in my parent template.

I just did a pull on the repo yesterday and installed from the latest commit.

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

@jorgebastida my project seems to be working ok now. I'll keep an eye on it. Not sure what the problem was exactly. Seems this code chunk document.location.href='{% url the_projects.search.all %}'; in the same function was causing some problems if it was placed after the Dajaxice calls.

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

@jorgebastida Sorry to keep bringing this up. I Think I've managed to get FF working. However Chomium/Chrome gives me the Something goes wrong message but still seems to carry out the task. This happens when I call document.location.href='{% url the_projects.search.all %}'; at the same time as my two Dajaxice calls. The error that comes up in the developer panel for chromium is Failed to load resource and points to my two ajax functions the_projects.sessionreset and the_projects.clearsearch. Any ideas as to why this is happening?

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

I think I may have a work around for the problem. I am trying your redirect api option. I didn't notice this until I looked closer.

from django-dajaxice.

everpcpc avatar everpcpc commented on July 20, 2024

@bmeyer71 I'm having the same problem now. How did you get FF working? Is there anything different between ff and chrome?

from django-dajaxice.

bmeyer71 avatar bmeyer71 commented on July 20, 2024

@everpcpc I'm in the process of reworking that section of the project. However, at that time, my solution was to use page_redirect.

from django-dajaxice.

jorgebastida avatar jorgebastida commented on July 20, 2024

Not sure if related, but probably... yes.
I'm working on a BIG update for both django-dajaxice and django-dajax. The branch I'm working on is develop (https://github.com/jorgebastida/django-dajaxice/tree/develop) here you have the diff (master...develop) I you can test your app with this 0.5 version, that'll be really interesting. I'll release it soon.

from django-dajaxice.

Ghopper21 avatar Ghopper21 commented on July 20, 2024

FYI, on the general question in the original issue about how to tell what exactly has gone wrong when you get the "Some goes wrong" alert, what you need to do is configure Django's LOGGING in settings.py to do something useful with the exception messages dajaxice is creating. Specifically, you need to add a handler for 'dajaxice' -- the logging name dajaxice uses for its messages.

For instance, to print exceptions etc. to the console, in your settings.py use:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler'
        }
    },
    'loggers': {
        'dajaxice': {
            'handlers': ['console'],
            'level': 'ERROR',
            'propagate': True,
        },
}

from django-dajaxice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.