Skip to content

TemplateHTMLRenderer error blocks BrowsableAPIRenderer #1001

@egasimus

Description

@egasimus

I have the following renderer stack:

REST_FRAMEWORK = {
    'DEFAULT_RENDERER_CLASSES': (
        'rest_framework.renderers.TemplateHTMLRenderer',
        'rest_framework.renderers.BrowsableAPIRenderer',
        'rest_framework.renderers.JSONRenderer',
    )
}

Let's say I have a view which doesn't have a template_name assigned. Quite expectedly, trying to open it makes TemplateHTMLRenderer spit out a nice TemplateDoesNotExist exception, and fail.

What I consider unexpected behavior, however, is the fact that, if I open that same URL with a ?format=api, I still get the same error, even though BrowsableAPIRenderer doesn't need the missing template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions