Hello, I'm a long-time python user who is new to django, javascript,
and Mochikit. I'm very pleased with django so far but I'm having a bit
of a quandry as I start to mix in javascript and Mochikit.

One thing I like about django is that if I make an error in my python
code it send me that great debug/traceback page.  This works well if I
submit a form as well. However, I've stared to get more adventurous
with Mochikit and am trying to communicate with the server outside of a
form.

Of course, as I experiment, I make mistakes and I get back to my
javascript console (thank you mochikit) a status=500 error and an
xmlHttpRequest failed error.

I know I made a mistake in my python code in views.py, and I know that
django probably caught it and generated a traceback but I dont' know
how to look at it.

This has slowed down my coding cycle a great deal. Do others have
tricks to get at this? Is it stored in the failed response on the
javascript side? It seems if I could get access to it I could pop up a
window and display it or log it somewhere.

Many thanks for any help in advance. I will put a little code below to
give an idea of what I'm doing.

-chris


=== example ===
in my template I might have something like this in the <script> section

content = { name : 'value'};
d=doSimpleXMLHttpRequest('myurl', content);
d.addCallbacks(successcallback, errorcallback);

-- in views.py ---

def myurl(request):
    if request.POST:
        # process the post response etc.
        #, maybe make an error somewhere here
        return HttpResponse(result, mimetype='application/json')


---------------------
in the web page when the error is it, I log the object that's returned
to "errorcallback"on the console. It looks like:
INFO: error in xml http request:
INFO: MochiKit.Async.XMLHttpRequestError("Request failed")
INFO: status: 500


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to