I've just changed to a new domain for my remote server, which was already serving JSON via Django Rest Framework (2.4.x).
Prior to the change, it smoothly authenticated users. However, after the switch, it's now throwing the error mentioned in the title.
Feels like a CSRF thing, but I don't know what to fix, or where to sleuth.
Pointers?
Edit:
Traceback:
Traceback (most recent call last):
File ".../project_path/project_name/urls.py", line 584, in list
related_field = self.request.user.relatedfield
AttributeError: 'AnonymousUser' object has no attribute 'relatedfield'
DRF Settings:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.BasicAuthentication',
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
),
'DEFAULT_FILTER_BACKENDS': (
'rest_framework.filters.DjangoFilterBackend',
),
'PAGINATE_BY': 10, # Default to 10
'PAGINATE_BY_PARAM': 'page_size', # Allow client to override, using `?page_size=xxx`.
'MAX_PAGINATE_BY': 999 # Maximum limit allowed when using `?page_size=xxx`.
}