Getting exception from djangorestframework












0















I am getting the following exception from djangorestframework's JSONEncoder class:



Traceback:

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
156. response = self.process_exception_by_middleware(e, request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
154. response = response.render()

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/template/response.py" in render
106. self.content = self.rendered_content

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/response.py" in rendered_content
72. ret = renderer.render(self.data, accepted_media_type, context)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/renderers.py" in render
106. allow_nan=not self.strict, separators=separators

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/json.py" in dumps
28. return json.dumps(*args, **kwargs)

File "/usr/lib/python3.6/json/__init__.py" in dumps
238. **kw).encode(obj)

File "/usr/lib/python3.6/json/encoder.py" in encode
199. chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python3.6/json/encoder.py" in iterencode
257. return _iterencode(o, 0)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/encoders.py" in default
56. elif (coreapi is not None) and isinstance(obj, (coreapi.Document, coreapi.Error)):

Exception Type: AttributeError at /v0/ui/website/subject-assignment/
Exception Value: module 'coreapi' has no attribute 'Document'


So, basically, it is saying my application (coreapi) does not have Document attribute. All the other apis are working fine but it is giving this error in one particular api. I can't find anything different with that api as well. Is there anything wrong with the djangorestframework or any idea what should I do to debug?



Note: I am using django 2.1.4, djangorestframework==3.9.0 and python version is 3.6.5.










share|improve this question























  • Do the other working APIs also share the same virtual environment env_md?

    – Will Keeling
    Jan 3 at 21:03













  • yes, there is only one environment I am using, and all the other apis are working apart from this.

    – Kshitij Mittal
    Jan 4 at 6:43
















0















I am getting the following exception from djangorestframework's JSONEncoder class:



Traceback:

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
156. response = self.process_exception_by_middleware(e, request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
154. response = response.render()

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/template/response.py" in render
106. self.content = self.rendered_content

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/response.py" in rendered_content
72. ret = renderer.render(self.data, accepted_media_type, context)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/renderers.py" in render
106. allow_nan=not self.strict, separators=separators

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/json.py" in dumps
28. return json.dumps(*args, **kwargs)

File "/usr/lib/python3.6/json/__init__.py" in dumps
238. **kw).encode(obj)

File "/usr/lib/python3.6/json/encoder.py" in encode
199. chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python3.6/json/encoder.py" in iterencode
257. return _iterencode(o, 0)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/encoders.py" in default
56. elif (coreapi is not None) and isinstance(obj, (coreapi.Document, coreapi.Error)):

Exception Type: AttributeError at /v0/ui/website/subject-assignment/
Exception Value: module 'coreapi' has no attribute 'Document'


So, basically, it is saying my application (coreapi) does not have Document attribute. All the other apis are working fine but it is giving this error in one particular api. I can't find anything different with that api as well. Is there anything wrong with the djangorestframework or any idea what should I do to debug?



Note: I am using django 2.1.4, djangorestframework==3.9.0 and python version is 3.6.5.










share|improve this question























  • Do the other working APIs also share the same virtual environment env_md?

    – Will Keeling
    Jan 3 at 21:03













  • yes, there is only one environment I am using, and all the other apis are working apart from this.

    – Kshitij Mittal
    Jan 4 at 6:43














0












0








0








I am getting the following exception from djangorestframework's JSONEncoder class:



Traceback:

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
156. response = self.process_exception_by_middleware(e, request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
154. response = response.render()

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/template/response.py" in render
106. self.content = self.rendered_content

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/response.py" in rendered_content
72. ret = renderer.render(self.data, accepted_media_type, context)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/renderers.py" in render
106. allow_nan=not self.strict, separators=separators

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/json.py" in dumps
28. return json.dumps(*args, **kwargs)

File "/usr/lib/python3.6/json/__init__.py" in dumps
238. **kw).encode(obj)

File "/usr/lib/python3.6/json/encoder.py" in encode
199. chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python3.6/json/encoder.py" in iterencode
257. return _iterencode(o, 0)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/encoders.py" in default
56. elif (coreapi is not None) and isinstance(obj, (coreapi.Document, coreapi.Error)):

Exception Type: AttributeError at /v0/ui/website/subject-assignment/
Exception Value: module 'coreapi' has no attribute 'Document'


So, basically, it is saying my application (coreapi) does not have Document attribute. All the other apis are working fine but it is giving this error in one particular api. I can't find anything different with that api as well. Is there anything wrong with the djangorestframework or any idea what should I do to debug?



Note: I am using django 2.1.4, djangorestframework==3.9.0 and python version is 3.6.5.










share|improve this question














I am getting the following exception from djangorestframework's JSONEncoder class:



Traceback:

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
156. response = self.process_exception_by_middleware(e, request)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
154. response = response.render()

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/django/template/response.py" in render
106. self.content = self.rendered_content

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/response.py" in rendered_content
72. ret = renderer.render(self.data, accepted_media_type, context)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/renderers.py" in render
106. allow_nan=not self.strict, separators=separators

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/json.py" in dumps
28. return json.dumps(*args, **kwargs)

File "/usr/lib/python3.6/json/__init__.py" in dumps
238. **kw).encode(obj)

File "/usr/lib/python3.6/json/encoder.py" in encode
199. chunks = self.iterencode(o, _one_shot=True)

File "/usr/lib/python3.6/json/encoder.py" in iterencode
257. return _iterencode(o, 0)

File "/home/ubuntu/Envs/env_md/lib/python3.6/site-packages/rest_framework/utils/encoders.py" in default
56. elif (coreapi is not None) and isinstance(obj, (coreapi.Document, coreapi.Error)):

Exception Type: AttributeError at /v0/ui/website/subject-assignment/
Exception Value: module 'coreapi' has no attribute 'Document'


So, basically, it is saying my application (coreapi) does not have Document attribute. All the other apis are working fine but it is giving this error in one particular api. I can't find anything different with that api as well. Is there anything wrong with the djangorestframework or any idea what should I do to debug?



Note: I am using django 2.1.4, djangorestframework==3.9.0 and python version is 3.6.5.







django python-3.x django-rest-framework






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 3 at 18:13









Kshitij MittalKshitij Mittal

1,4321527




1,4321527













  • Do the other working APIs also share the same virtual environment env_md?

    – Will Keeling
    Jan 3 at 21:03













  • yes, there is only one environment I am using, and all the other apis are working apart from this.

    – Kshitij Mittal
    Jan 4 at 6:43



















  • Do the other working APIs also share the same virtual environment env_md?

    – Will Keeling
    Jan 3 at 21:03













  • yes, there is only one environment I am using, and all the other apis are working apart from this.

    – Kshitij Mittal
    Jan 4 at 6:43

















Do the other working APIs also share the same virtual environment env_md?

– Will Keeling
Jan 3 at 21:03







Do the other working APIs also share the same virtual environment env_md?

– Will Keeling
Jan 3 at 21:03















yes, there is only one environment I am using, and all the other apis are working apart from this.

– Kshitij Mittal
Jan 4 at 6:43





yes, there is only one environment I am using, and all the other apis are working apart from this.

– Kshitij Mittal
Jan 4 at 6:43












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54027639%2fgetting-exception-from-djangorestframework%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54027639%2fgetting-exception-from-djangorestframework%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas