Navigation Menu

Skip to content

Commit

Permalink
add pygments CSS block in browsable API views (encode#5584)
Browse files Browse the repository at this point in the history
  • Loading branch information
merwok authored and Pierre Chiquet committed Mar 24, 2020
1 parent a6ee41b commit e50875a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rest_framework/renderers.py
Expand Up @@ -383,6 +383,7 @@ class BrowsableAPIRenderer(BaseRenderer):
format = 'api'
template = 'rest_framework/api.html'
filter_template = 'rest_framework/filters/base.html'
code_style = 'emacs'
charset = 'utf-8'
form_renderer_class = HTMLFormRenderer

Expand Down Expand Up @@ -672,6 +673,7 @@ def get_context(self, data, accepted_media_type, renderer_context):

context = {
'content': self.get_content(renderer, data, accepted_media_type, renderer_context),
'code_style': pygments_css(self.code_style),
'view': view,
'request': request,
'response': response,
Expand Down

0 comments on commit e50875a

Please sign in to comment.