#22621: Return JSON response in default error handlers for ajax requests -----------------------------+-------------------------------------- Reporter: Elvard | Owner: nobody Type: New feature | Status: new Component: Core (URLs) | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -----------------------------+-------------------------------------- Changes (by timo):
* needs_better_patch: => 0 * needs_tests: => 0 * needs_docs: => 0 Comment: The main issue I see is that I'm not sure there's a standard format for returning JSON errors. I found [https://pypi.python.org/pypi/django- jsonview/0.3.0 django-jsonview] which returns {{{ json.dumps({ 'error': STATUS_CODE, 'message': str(exception), }) }}} which seems reasonable. I'm not convinced this functionality needs to live in Django since it's easy to redefine the error handlers based on your needs, but I'll leave it open for a second opinion. -- Ticket URL: <https://code.djangoproject.com/ticket/22621#comment:1> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.60865164a4c7fe1febe80ec4636d1b91%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.