Explain the difference between authentication_classes and permission_classes.

Last updated 17 June 2026

  • authentication_classes identify who is calling (token, session, JWT) and set request.user/request.auth. Failure just leaves the user anonymous.

  • permission_classes run afterward and decide if that identity may act, via has_permission()/has_object_permission() (e.g. IsAuthenticated).

  • Authentication failures typically return 401, while permission failures return 403.

  • https://www.geeksforgeeks.org/python/basic-authentication-django-rest-framework/
All Django interview questions