If you are getting this error it is because your view is not returning an
HttpResponse object. You need to wrap your return in an HttpResponse, or
use the shortcut render_to_response() like:

    return render_to_response('template.htm', {'data':
'to_supply_to_template'}, context_instance=RequestContext(request))

or:

    return HttpResponse(my_json_object)

This may not solve your problem and get dajax working, but it may be a step
in the right direction. I personally battled with some of the confining
aspects of Dajax and ultimately went back to using jQuery straight up. This
allowed me to write some client side trapping/displaying of errors. In my
views I try the code and catch exceptions, then report to admins and return
the error. My return callback javascript function is universal, it checks
the JSON object returned for the err field which is 0 or 1. If it is 1, the
error (stored in JSON['return_error']) is alerted to the user. If there was
no error, it goes through with the callback that was intended (which was
also stored in JSON['callback']). For me, this preserves the error
reporting to admins and allows the user to see that there was an exception,
instead of them thinking everything went through fine since it is input
from their perspective correctly.

Cheers,

Furbee

On Fri, May 4, 2012 at 8:48 AM, Tom Evans <tevans...@googlemail.com> wrote:

> On Fri, May 4, 2012 at 4:06 PM, doniyor <doniyor....@googlemail.com>
> wrote:
> > if i call the dajaxice.core.js directly from address bar, it shows an
> error
> > saying: ValueError at /dajaxice/dajaxice.core.js The view
> home.views.index
> > didn't return an HttpResponse object.
> >
> > so it means, i am serving dajaxice.core.js in a wrong way, right?
> >
>
> You may get better results asking about Dajax on the Dajax mailing list:
>
> http://groups.google.com/group/dajaxproject
>
> Cheers
>
> Tom
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to