Skip to main content

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

Release files for drf-is-not-authenticated 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drf-is-not-authenticated 1.0.0
File Size Uploaded
drf_is_not_authenticated_class-1.0.0.macosx-10.9-x86_64.tar.gz 2.3 kB Details

Release files / drf_is_not_authenticated_class-1.0.0.macosx-10.9-x86_64.tar.gz

Download URL drf_is_not_authenticated_class-1.0.0.macosx-10.9-x86_64.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5625ef97d88c26a9a6be03a32cfcdc291f0f66192ea4eb79918c3f7f46fec73c
BLAKE2b-256 checksum
How to use checksums
1c2e2cc69b09d48c53ddf12b8375ac9551bd6f5dc5a35e7058e4e9a5ac734fd6
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page