django rest framework default_authentication_classes 1

django rest framework default_authentication_classes

'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework.authentication.BasicAuthentication'
    ]

Here is what the above code is Doing:
1. We’re importing the rest_framework.authentication module.
2. We’re setting the DEFAULT_AUTHENTICATION_CLASSES setting to a tuple of authentication classes.
3. We’re including the SessionAuthentication class, which enables cookie-based authentication.
4. We’re including the BasicAuthentication class, which enables basic HTTP authentication.

Similar Posts