I set basic authentication in my setting.py as follows. Now I need a view that doesn't use basic authentication. How can I do it.
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',),
}
To exclude a view from authentication, set
authentication_classes
andpermission_classes
to[]
.You simply need to set the
authentication_classes
on your view. Have a look at http://www.django-rest-framework.org/api-guide/authentication/#setting-the-authentication-scheme for an example.Edit: To remove authentication, set the
authentication_classes
to an empty list. Don't forget to remove permissions as well since they usually rely on authentication.