How Can I Disable Authentication in Django REST Framework

后端 未结 7 927
庸人自扰
庸人自扰 2020-12-13 23:11

I\'m working on a store site, where every user is going to be anonymous (well, until it\'s time to pay at least), and I\'m trying to use Django REST Framework to serve the p

7条回答
  •  误落风尘
    2020-12-14 00:00

    You can give empty defaults for the permission and authentication classes in your settings.

    REST_FRAMEWORK = {
        # other settings...
    
        'DEFAULT_AUTHENTICATION_CLASSES': [],
        'DEFAULT_PERMISSION_CLASSES': [],
    }
    

提交回复
热议问题