Search code examples
django-rest-frameworkdjango-rest-authdjango-rest-framework-jwt

I can't see DRF api confirm browser


i want to see THIS

But my browser is This

I checked the api operation through postman.

i have no idea what is the problem..

I don't think there's a problem with the code

This is my code project folder urls.py

url(r'^', include('django.contrib.auth.urls')),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
url(r'^account/', include('allauth.urls')),
url(r'^accounts-rest/registration/account-confirm-email/(?P<key>.+)/$',
    confirm_email, name='account_confirm_email'),

settings.py

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': (
        # 'rest_framework.permissions.IsAuthenticated',
        'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
    ),
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
    ],
    'DEFAULT_RENDERER_CLASSES': [
        'rest_framework.renderers.JSONRenderer',
    ],
}
REST_AUTH_SERIALIZERS = {
    'USER_DETAILS_SERIALIZER': 'accounts.serializers.UserSerializer',
}

Any hint would be very very very appreciated :)


Solution

  • Add rest_framework.renderers.BrowsableAPIRenderer to default renderer classes of the REST_FRAMEWORK settings.

    ...
    'DEFAULT_RENDERER_CLASSES': [
            'rest_framework.renderers.JSONRenderer',
            'rest_framework.renderers.BrowsableAPIRenderer',
      ]
    ...