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_class

Use cases

  1. Only not registered users should be able to create new user
from drf_is_not_authenticated_class 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

drf_is_not_authenticated_class-1.0.0.win32.zip (9.2 kB view details)

Uploaded Source

File details

Details for the file drf_is_not_authenticated_class-1.0.0.win32.zip.

File metadata

  • Download URL: drf_is_not_authenticated_class-1.0.0.win32.zip
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for drf_is_not_authenticated_class-1.0.0.win32.zip
Algorithm Hash digest
SHA256 6384191d297a9f29d2dc64d588de870a26f8588f0186c677b5369f617bc5cca0
MD5 f996246c40b3280b0e0bb09a027dc85d
BLAKE2b-256 780886bee5752d6c5bca635f85e479620ee02af05dc63181c15e80917491a5aa

See more details on using hashes here.

Supported by

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