Add interactive docs error template by carltongibson · Pull Request #5548 · encode/django-rest-framework (original) (raw)

Closes #5496

Adds a plain error template for DocumentationRenderer.

Previously we've not had to switch template for the error case, since both cases are presented the same. With the interactive docs we need to switch to a different template. (We do this by checking whether we have a coreapi.Document, as expected, or not.)

I've not added any styling here. For the 90% case seeing this template is a configuration error, so I've added DEBUG-only notes for explaining that.

Those that need a better template can easily override in their own projects.

We can happily take PRs improving this template, but I'd rather leave that for community input at this point.