We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I need to hide {"detail": errors} on prod env. It's error after _get_values(request, kw)
_get_values(request, kw)
I think, we should add some param to NinjaAPI, like hide_errors, to hide detail in error. @vitalik do you approve this solution?
The text was updated successfully, but these errors were encountered:
this will be possible with custom response classes (along with #6)
Sorry, something went wrong.
@fojetin
This is now possible with response renderers
from ninja.renderers import JSONRenderer class MyRenderer(JSONRenderer): def render(self, request, data, *, response_status): if not settings.DEBUG and response_status == 422: data = {"error": True} return super().render(request, data, response_status=response_status) api = NinjaAPI(renderer=MyRenderer())
No branches or pull requests
Hi! I need to hide {"detail": errors} on prod env. It's error after
_get_values(request, kw)
I think, we should add some param to NinjaAPI, like hide_errors, to hide detail in error.
@vitalik do you approve this solution?
The text was updated successfully, but these errors were encountered: