Skip to content
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

Browsable API #81

Merged
merged 1 commit into from
Dec 8, 2021
Merged

Browsable API #81

merged 1 commit into from
Dec 8, 2021

Conversation

stevelacey
Copy link
Contributor

@stevelacey stevelacey commented Dec 6, 2021

What does this PR do?

Adds a html ui when hitting endpoints in a web browser, which presents the output nicely for debugging, and means that Django can inject the debug toolbar.

Also drops worf's gzipmiddleware usage, apps can add that to their middleware stack if they want it, injecting it from within worf makes it difficult to order middlewares correctly so things like debug toolbar will work.

Based loosely on https://www.django-rest-framework.org/topics/browsable-api/

What issue does this solve?

I needed django debug toolbar.

Where should the reviewer start?

Hit up an api endpoint in Chrome.

Screenshots

What Worf gif best describes this PR or how it makes you feel?

Udvr

Checklist

  • This PR increases test coverage
  • This PR includes README updates reflecting any new features/improvements to the framework
    • Template means that worf needs adding to INSTALLED_APPS
    • There's a couple of new settings for specifying api name/root url; though this could be done via overriding the template
  • Might want to support an ?format=json or similar override

@stevelacey stevelacey force-pushed the improvement/browsable-api branch 13 times, most recently from dd25317 to 7ba11b7 Compare December 8, 2021 08:01
@stevelacey stevelacey force-pushed the improvement/browsable-api branch from 7ba11b7 to 2e23c4e Compare December 8, 2021 08:02
@stevelacey stevelacey marked this pull request as ready for review December 8, 2021 08:04
@stevelacey stevelacey merged commit d8a4abc into master Dec 8, 2021
@stevelacey stevelacey deleted the improvement/browsable-api branch December 8, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant