def debug_log(request): if request.method != 'POST' or not settings.HAVE_RAVEN or not settings.HAVE_SENTRY: raise Http404('Method not supported') form = forms.DebugLogForm(request.POST) if not form.is_valid(): raise krest.BadRequestError(_form_errors(form)) client = LocalRavenClient([]) message = form.cleaned_data['message'] ident = client.get_ident(client.create_from_text(message)) client.send() return {'log_id': ident}
def debug_log(request): if request.method != 'POST' or not settings.HAVE_RAVEN or not settings.HAVE_SENTRY: raise Http404('Method not supported') form = forms.DebugLogForm(request.POST) if not form.is_valid(): raise kbapi.BadRequestError(_form_errors(form)) client = LocalRavenClient([]) message = form.cleaned_data['message'] ident = client.get_ident(client.create_from_text(message)) client.send() return {'log_id': ident}
def report(request, project_id=None): if request.method == 'POST': data = request.raw_post_data if not data: return HttpResponseBadRequest() try: decoded = simplejson.loads(data) except simplejson.JSONDecodeError: return HttpResponseBadRequest() response = HttpResponse() client.send(auth_header=extract_auth_vars(request), **decoded) elif request.method == 'OPTIONS': response = HttpResponse() return response
def report(request): if request.method == 'POST': data = request.raw_post_data if not data: return HttpResponseBadRequest() try: decoded = simplejson.loads(data) except simplejson.JSONDecodeError: return HttpResponseBadRequest() response = HttpResponse() client.send(**decoded) elif request.method == 'OPTIONS': response = HttpResponse() return response
def report(request, project_id=None): if request.method == 'OPTIONS': return HttpResponse() if request.method == 'POST': if hasattr(request, 'body'): data = request.body else: data = request.raw_post_data else: data = request.GET.get('sentry_data') if not data: return HttpResponseBadRequest() try: decoded = json.loads(data.decode('utf8')) except json.JSONDecodeError: return HttpResponseBadRequest() client.send(auth_header=extract_auth_vars(request), **decoded) return HttpResponse()
def report(request, project_id=None): if request.method == 'OPTIONS': return HttpResponse() if request.method == 'POST': data = request.raw_post_data else: data = request.GET.get('sentry_data') if not data: return HttpResponseBadRequest() try: decoded = json.loads(data) except json.JSONDecodeError: return HttpResponseBadRequest() client.send(auth_header=extract_auth_vars(request), **decoded) return HttpResponse()
def report(request, project_id=None): if request.method == "OPTIONS": return HttpResponse() if request.method == "POST": if hasattr(request, "body"): data = request.body else: data = request.raw_post_data else: data = request.GET.get("sentry_data") if not data: return HttpResponseBadRequest() try: decoded = json.loads(data.decode("utf8")) except json.JSONDecodeError: return HttpResponseBadRequest() client.send(auth_header=extract_auth_vars(request), **decoded) return HttpResponse()