How Can I Disable Authentication in Django REST Framework

后端 未结 7 915
庸人自扰
庸人自扰 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:07

    Here is an alternative to simply enable the API forms for development purposes:

    settings.py

    REST_FRAMEWORK = {
        'DEFAULT_PERMISSION_CLASSES': [
            'rest_framework.permissions.AllowAny'
        ]
    }
    

    Django REST framework v3.11.0

提交回复
热议问题