First, make sure you use the SessionAuthentication in Django. Put this in your settings.py
# Django rest framework
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication'| from django.contrib.auth.models import User | |
| from django.contrib.auth.models import Group | |
| from django.contrib.auth.models import Permission | |
| from django.contrib.contenttypes.models import ContentType | |
| # PERMISSÕES | |
| # Permissões geralmente são usadas para fazer controle de acesso. | |
| # Exemplo prático: Num sistema de gerenciamento a área de marketing pode acessar | |
| # a área de Analytics da empresa. | |
| # Implementação prática com as permissões do Django. |