Skip to content

fix: Remove BrowsableAPIRenderer default when not running in DEBUG mode #135

New issue

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

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

MgenGlder
Copy link
Contributor

@MgenGlder MgenGlder commented Mar 9, 2025

Closes #134

Summary

  • Disables BrowsableAPIRenderer by default and enables it only when DEBUG is set to True in the Django settings.

Context

We currently enable the Django BrowsableAPIRenderer that's part of the Django Rest Framework by default, but I think it might be better to just disable it. This PR disables it by default, but allows it to be enabled by setting DEBUG to True. An example of an API that does this is https://api.dearborncodingclub.com/profile/.

Screenshots

Screenshot 2025-03-09 at 4 42 51 PM

@MgenGlder MgenGlder changed the title fix: Remove JSONViewer default when not running in DEBUG mode fix: Remove BrowsableAPIRenderer default when not running in DEBUG mode Mar 9, 2025
@MgenGlder MgenGlder marked this pull request as ready for review March 9, 2025 20:51
@MgenGlder MgenGlder requested a review from a team as a code owner March 9, 2025 20:51
@MgenGlder MgenGlder self-assigned this Mar 9, 2025
@MgenGlder MgenGlder added the enhancement New feature or request label Mar 9, 2025
@MgenGlder MgenGlder moved this to In Progress in Project Board Mar 9, 2025
Copy link
Contributor

@alvi1316 alvi1316 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@MgenGlder MgenGlder merged commit 1fa1904 into main Mar 10, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Project Board Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Disable the BrowsableAPIRenderer for the Django application
2 participants