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

ujson breaks BrowsableAPIRenderer #11

Open
cdrandin opened this issue Nov 15, 2017 · 2 comments
Open

ujson breaks BrowsableAPIRenderer #11

cdrandin opened this issue Nov 15, 2017 · 2 comments

Comments

@cdrandin
Copy link

cdrandin commented Nov 15, 2017

I noticed this being an issue in the past #4, however, it seems it is still causing issues.

The rendering displays the json all on a single line and links are presented as {"user":"http:\/\/127.0.0.1:8000\/user\/"}

Using:

  • Django (1.11.5)
  • djangorestframework (3.7.3)
@radzhome
Copy link

This is because you have to include the defaults as well like so

    'DEFAULT_RENDERER_CLASSES': (
        'drf_ujson.renderers.UJSONRenderer',
        'rest_framework.renderers.BrowsableAPIRenderer',
    ),
    'DEFAULT_PARSER_CLASSES': (
        'drf_ujson.parsers.UJSONParser',
        'rest_framework.parsers.FormParser',
        'rest_framework.parsers.MultiPartParser'
    ),

@radzhome
Copy link

I fixed the readme and updated the classes here - https://github.com/radzhome/drf-ujson-renderer

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

No branches or pull requests

2 participants