[Django]-Django REST Swagger not showing POST methods

3👍

I’ve figured it out. I haven’t been logged in properly so I haven’t been authenticated against permissions listed in DEFAULT_PERMISSION_CLASSES setting for DRF in settings.py.

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES':
        ('rest_framework.permissions.IsAuthenticatedOrReadOnly',),
}

HTTP methods POST, PUT, PATCH, etc. are checked using has_permission() against list of permissions defined there.

After logging in it works well.

EDIT: Problem with login was, that Django-rest-swagger 2.2.0 is not working correctly with JWT authentication, so I downgraded to 2.1.2.

Leave a comment