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

rest_framework/api.html TemplateDoesNotExist #55

Closed
atlasrealm opened this issue Feb 19, 2025 · 1 comment · Fixed by #56
Closed

rest_framework/api.html TemplateDoesNotExist #55

atlasrealm opened this issue Feb 19, 2025 · 1 comment · Fixed by #56
Labels
bug Something isn't working good first issue Good for newcomers server-side

Comments

@atlasrealm
Copy link
Contributor

atlasrealm commented Feb 19, 2025

From time to time we are seeing this error: rest_framework/api.html TemplateDoesNotExist, which is probably bots trying to access the browsable api from the rest framework. However, I think it means "rest_framework" should be added to INTALLED_APPS? See: https://stackoverflow.com/questions/38366861/django-templatedoesnotexist-rest-framework-api-html

Btw, you can configure django rest framework to not support these html responses by adding this setting:

REST_FRAMEWORK = {"DEFAULT_RENDERER_CLASSES": ["rest_framework.renderers.JSONRenderer"]}

@Stormheg
Copy link
Member

Thanks you for the report Almer.

These are exactly the kind of small issues I hope to hear about before marking this package as 'usable in production'.

Probably should set the renders explicitly on the views: https://www.django-rest-framework.org/api-guide/renderers/#setting-the-renderers

Not planning on utilizing the browsable api for this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers server-side
Development

Successfully merging a pull request may close this issue.

2 participants