This project demonstrates a complete implementation of JWT authentication and various permission levels in DRF.
djangorestframework-simplejwt.AllowAny: Public endpoints (Registration, Public Demo).IsAuthenticated: Protected endpoints (Profile, Notes).IsAdminUser: Admin-only demonstration.IsOwnerOrReadOnly: Object-level permission for the Note model.pip install django djangorestframework djangorestframework-simplejwt
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
drf_auth_collection.json file into Postman.base_url variable (default: http://127.0.0.1:8000).access_token and refresh_token to Postman variables.core/: Project configuration and settings.authentication_app/: Main logic for users, notes, and permissions.
serializers.py: User and Note serializers.views.py: API implementions.permissions.py: Custom logic for access control.urls.py: App-specific routing.Please try visiting these specific API endpoints to see the DRF interface:
Public Demo: http://127.0.0.1:8000/api/auth/public/ Registration: http://127.0.0.1:8000/api/auth/register/ Login: http://127.0.0.1:8000/api/auth/login/