Skip to main content

Django Rest Framework Authentication Class for not authorized users

Project description

Django Rest Framework Authentication Class for not authorized users

Some DRF views should not be accessible by logged in users. In such cases we need permission class that will not allow authorized users to access the resource or action.

Installation

pip install drf_is_not_authenticated

Use cases

  1. Only not registered users should be able to create new user
from drf_is_not_authenticated import IsNotAuthenticated


class RegisterUser(CreateAPIView):
    queryset=User.objects.all()
    permission_classes = (IsNotAuthenticated,)

Contribution

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page