when I want to post data and create a new teacher it gives me this error and I don't know what to do please help me
Asked
Active
Viewed 280 times
-2
-
4Please paste code instead of uploading images of code, see how do I ask a good question [ask]. – Sunderam Dubey Oct 04 '22 at 15:04
1 Answers
0
You need to edit your settings.py and add this :
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAdminUser'
),
}
But have look for better insight https://www.django-rest-framework.org/api-guide/settings/

Gaëtan GR
- 1,380
- 1
- 5
- 21