yceruto/django-ajax — pull request #7 by ManuelGysin (2014-08-24 20:23:16+00:00)
Title: Added simply logging

Hello!

Debugging can be very hard with your current implementation.
I've added an simple logger instance which logs the traceback on an Exception.

Output is like:

```
[24/Aug/2014 20:18:48] ERROR [django_ajax.decorators:inner():75] list index out of range with json
[24/Aug/2014 20:18:48] ERROR [django_ajax.decorators:inner():76] File "/usr/lib/python2.7/site-packages/django_ajax/decorators.py", line 72, in inner
return render_to_json(func(request, *args, **kwargs))

File "/var/gui/interface/views.py", line 70, in api_request
api.account_actions(request, action, data, values)

File "/usr/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
return view_func(request, *args, **kwargs)

File "/var/gui/interface/utils.py", line 54, in account_actions
return account_views.settings_get(request, values)

File "/usr/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
return view_func(request, *args, **kwargs)

File "/var/gui/account/views.py", line 161, in settings_get
settings = settings[2]

File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 177, in __getitem__
return list(qs)[0]
```

Greets
Manuel