HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>


json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) // Werkzeug Debugger





json.decoder.JSONDecodeError

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Traceback (most recent call last)

  • File “/usr/local/lib/python3.7/json/decoder.py”,
    line 353,
    in raw_decode

            This can be used to decode a JSON document from a string that may
            have extraneous data at the end.
     
            """
            try:
                obj, end = self.scan_once(s, idx)
            except StopIteration as err:
                raise JSONDecodeError("Expecting value", s, err.value) from None
            return obj, end
  • During handling of the above exception, another exception occurred:
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/wsgi.py”,
    line 141,
    in __call__

     
        def __call__(self, environ, start_response):
            set_script_prefix(get_script_name(environ))
            signals.request_started.send(sender=self.__class__, environ=environ)
            request = self.request_class(environ)
            response = self.get_response(request)
     
            response._handler_class = self.__class__
     
            status = '%d %s' % (response.status_code, response.reason_phrase)
            response_headers = [
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py”,
    line 75,
    in get_response

     
        def get_response(self, request):
            """Return an HttpResponse object for the given HttpRequest."""
            # Setup default url resolver for this thread
            set_urlconf(settings.ROOT_URLCONF)
            response = self._middleware_chain(request)
            response._closable_objects.append(request)
            if response.status_code >= 400:
                log_response(
                    '%s: %s', response.reason_phrase, request.path,
                    response=response,
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py”,
    line 36,
    in inner

        @wraps(get_response)
        def inner(request):
            try:
                response = get_response(request)
            except Exception as exc:
                response = response_for_exception(request, exc)
            return response
        return inner
     
     
    def response_for_exception(request, exc):
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py”,
    line 90,
    in response_for_exception

            # Allow sys.exit() to actually exit. See tickets #1023 and #4701
            raise
     
        else:
            signals.got_request_exception.send(sender=None, request=request)
            response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
            log_response(
                '%s: %s', response.reason_phrase, request.path,
                response=response,
                request=request,
                exc_info=sys.exc_info(),
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py”,
    line 125,
    in handle_uncaught_exception

        """
        if settings.DEBUG_PROPAGATE_EXCEPTIONS:
            raise
     
        if settings.DEBUG:
            return debug.technical_500_response(request, *exc_info)
     
        # Return an HttpResponse that displays a friendly error message.
        callback, param_dict = resolver.resolve_error_handler(500)
        return callback(request, **param_dict)
  • File “/usr/local/lib/python3.7/site-packages/django_extensions/management/technical_response.py”,
    line 37,
    in null_technical_500_response

            elif tld.wsgi_tb:
                tb = tld.wsgi_tb
        except AttributeError:
            pass
     
        six.reraise(exc_type, exc_value, tb)
  • File “/usr/local/lib/python3.7/site-packages/six.py”,
    line 702,
    in reraise

        def reraise(tp, value, tb=None):
            try:
                if value is None:
                    value = tp()
                if value.__traceback__ is not tb:
                    raise value.with_traceback(tb)
                raise value
            finally:
                value = None
                tb = None
     
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py”,
    line 34,
    in inner

        can rely on getting a response instead of an exception.
        """
        @wraps(get_response)
        def inner(request):
            try:
                response = get_response(request)
            except Exception as exc:
                response = response_for_exception(request, exc)
            return response
        return inner
     
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py”,
    line 115,
    in _get_response

            if response is None:
                wrapped_callback = self.make_view_atomic(callback)
                try:
                    response = wrapped_callback(request, *callback_args, **callback_kwargs)
                except Exception as e:
                    response = self.process_exception_by_middleware(e, request)
     
            # Complain if the view returned None (a common error).
            if response is None:
                if isinstance(callback, types.FunctionType):    # FBV
                    view_name = callback.__name__
  • File “/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py”,
    line 113,
    in _get_response

                    break
     
            if response is None:
                wrapped_callback = self.make_view_atomic(callback)
                try:
                    response = wrapped_callback(request, *callback_args, **callback_kwargs)
                except Exception as e:
                    response = self.process_exception_by_middleware(e, request)
     
            # Complain if the view returned None (a common error).
            if response is None:
  • File “/usr/local/lib/python3.7/contextlib.py”,
    line 74,
    in inner

     
        def __call__(self, func):
            @wraps(func)
            def inner(*args, **kwds):
                with self._recreate_cm():
                    return func(*args, **kwds)
            return inner
     
     
    class _GeneratorContextManagerBase:
        """Shared functionality for @contextmanager and @asynccontextmanager."""
  • File “/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py”,
    line 54,
    in wrapped_view

    def csrf_exempt(view_func):
        """Mark a view function as being exempt from the CSRF view protection."""
        # view_func.csrf_exempt = True would also work, but decorators are nicer
        # if they don't have side effects, so return a new function.
        def wrapped_view(*args, **kwargs):
            return view_func(*args, **kwargs)
        wrapped_view.csrf_exempt = True
        return wraps(view_func)(wrapped_view)
  • File “/usr/local/lib/python3.7/site-packages/django/views/generic/base.py”,
    line 71,
    in view

                if not hasattr(self, 'request'):
                    raise AttributeError(
                        "%s instance has no 'request' attribute. Did you override "
                        "setup() and forget to call super()?" % cls.__name__
                    )
                return self.dispatch(request, *args, **kwargs)
            view.view_class = cls
            view.view_initkwargs = initkwargs
     
            # take name and docstring from class
            update_wrapper(view, cls, updated=())
  • File “/usr/local/lib/python3.7/site-packages/rest_framework/views.py”,
    line 505,
    in dispatch

                    handler = self.http_method_not_allowed
     
                response = handler(request, *args, **kwargs)
     
            except Exception as exc:
                response = self.handle_exception(exc)
     
            self.response = self.finalize_response(request, response, *args, **kwargs)
            return self.response
     
        def options(self, request, *args, **kwargs):
  • File “/usr/local/lib/python3.7/site-packages/rest_framework/views.py”,
    line 465,
    in handle_exception

     
            context = self.get_exception_handler_context()
            response = exception_handler(exc, context)
     
            if response is None:
                self.raise_uncaught_exception(exc)
     
            response.exception = True
            return response
     
        def raise_uncaught_exception(self, exc):
  • File “/usr/local/lib/python3.7/site-packages/rest_framework/views.py”,
    line 476,
    in raise_uncaught_exception

            if settings.DEBUG:
                request = self.request
                renderer_format = getattr(request.accepted_renderer, 'format')
                use_plaintext_traceback = renderer_format not in ('html', 'api', 'admin')
                request.force_plaintext_errors(use_plaintext_traceback)
            raise exc
     
        # Note: Views are made CSRF exempt from within `as_view` as to prevent
        # accidental removal of this exemption in cases where `dispatch` needs to
        # be overridden.
        def dispatch(self, request, *args, **kwargs):
  • File “/usr/local/lib/python3.7/site-packages/rest_framework/views.py”,
    line 502,
    in dispatch

                    handler = getattr(self, request.method.lower(),
                                      self.http_method_not_allowed)
                else:
                    handler = self.http_method_not_allowed
     
                response = handler(request, *args, **kwargs)
     
            except Exception as exc:
                response = self.handle_exception(exc)
     
            self.response = self.finalize_response(request, response, *args, **kwargs)
  • File “/app/contentyze/api/views.py”,
    line 116,
    in post

                source=CallModelLog.SOURCE_API
            )
            return Response(response.json(), status=response.status_code)
     
        def post(self, request, *args, **kwargs):
            return self.call_api(request, *args, **kwargs)
  • File “/app/contentyze/api/views.py”,
    line 113,
    in call_api

            response = requests.post(settings.MODEL_URL, json=data)
            CallModelLog.create_entry(
                username=username, params=data,
                source=CallModelLog.SOURCE_API
            )
            return Response(response.json(), status=response.status_code)
     
        def post(self, request, *args, **kwargs):
            return self.call_api(request, *args, **kwargs)
  • File “/usr/local/lib/python3.7/site-packages/requests/models.py”,
    line 898,
    in json

                        # Wrong UTF codec detected; usually because it's not UTF-8
                        # but some other 8-bit codec.  This is an RFC violation,
                        # and the server didn't bother to tell us what codec *was*
                        # used.
                        pass
            return complexjson.loads(self.text, **kwargs)
     
        @property
        def links(self):
            """Returns the parsed header links of the response, if any."""
     
  • File “/usr/local/lib/python3.7/json/__init__.py”,
    line 348,
    in loads

            s = s.decode(detect_encoding(s), 'surrogatepass')
     
        if (cls is None and object_hook is None and
                parse_int is None and parse_float is None and
                parse_constant is None and object_pairs_hook is None and not kw):
            return _default_decoder.decode(s)
        if cls is None:
            cls = JSONDecoder
        if object_hook is not None:
            kw['object_hook'] = object_hook
        if object_pairs_hook is not None:
  • File “/usr/local/lib/python3.7/json/decoder.py”,
    line 337,
    in decode

        def decode(self, s, _w=WHITESPACE.match):
            """Return the Python representation of ``s`` (a ``str`` instance
            containing a JSON document).
     
            """
            obj, end = self.raw_decode(s, idx=_w(s, 0).end())
            end = _w(s, end).end()
            if end != len(s):
                raise JSONDecodeError("Extra data", s, end)
            return obj
     
  • File “/usr/local/lib/python3.7/json/decoder.py”,
    line 355,
    in raw_decode

     
            """
            try:
                obj, end = self.scan_once(s, idx)
            except StopIteration as err:
                raise JSONDecodeError("Expecting value", s, err.value) from None
            return obj, end

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


This is the Copy/Paste friendly version of the traceback. You can also paste this traceback into
a gist:


The debugger caught an exception in your WSGI application. You can now
look at the traceback which led to the error.
If you enable JavaScript you can also use additional features such as code
execution (if the evalex feature is enabled), automatic pasting of the
exceptions and much more.

Console Locked

The console is locked and needs to be unlocked by entering the PIN.
You can find the PIN printed out on the standard output of your
shell that runs the server.

PIN: