"detail": "Authentication credentials were not provided." when I want to signup user

Peshangay Aram

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

this is my models.py enter image description here

this is my views.py enter image description here

this is my serializer.py enter image description here

Gaëtan GR

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/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Django Rest Framework - Authentication credentials were not provided

Authentication credentials were not provided with djangorestframework-jwt

Authentication credentials were not provided django-rest-auth

DRF API endpoint getting "Authentication credentials were not provided"

Authentication credentials were not provided when sending request from React JS axios

My database is not adding users when I signup

django-oauth-toolkit; Django Rest Framework - Authentication credentials were not provided

I want to show the detail of specific order when I click on button but it get rendered on every order as this is in for loop

I want to POST data to an API when user close the browser tab

Permission classess decorator is ignored. "Authentication credentials were not provided" response

Authentication credentials were not provided drf

Auth error with POST request: "Authentication credentials were not provided" using Axios, but works using POSTMAN

How to customize [Authentication credentials were not provided] error message in Django rest framework

When creating a user component I want to have Db Column in the schema

I want to unset the Session When User Press The Back Button

I want to raise an event ,when user opens a google form?

i want to change my status in database when user did something

Authentication credentials were not provided with Django Rest Framework JWT

I want to see the detail of the purchase React Admin

Django Authentication credentials were not provided

When the jQuery dialog is on I do not want the user to interact with the background

allow user to choose which email to signup with when using angular firebase signup with google

Python plotly choropleth map visualization , authentication credentials were not provided error

Python Requests with Django Rest Framework - 'detail': 'Authentication credentials were not provided'

i want redirect when user sellect seller it should go to the dashboard when user select buyer it go the homepage

I want the value of textfield when user prints enter

How to solve the error "Authentication credentials were not provided" while running a CURL get request in php?

I want to know when my user paused the application?

i want redirection to be done to account created when signup form is submitted