Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Creating a post #51

Open
kushalkumarmv opened this issue Sep 4, 2023 · 4 comments
Open

Error on Creating a post #51

kushalkumarmv opened this issue Sep 4, 2023 · 4 comments

Comments

@kushalkumarmv
Copy link

when put the right credentials to post request ,it getting an error !

{
"detail": "Authentication credentials were not provided."
}

I cross check each codelines ,there is no in error on viewsets.py file of post app

@s-azaar
Copy link

s-azaar commented Oct 6, 2023

@kushalkumarmv I think this is because you're not passing the Authorization header in your request (i.e. the JWT token)

@koladev32
Copy link
Collaborator

when put the right credentials to post request ,it getting an error !

{ "detail": "Authentication credentials were not provided." }

I cross check each codelines ,there is no in error on viewsets.py file of post app

Please @kushalkumarmv , can you provide a cURL of the request you are sending?

@Cvoluj
Copy link

Cvoluj commented Jan 20, 2024

I faced same problem after I added in settings.py this lines:

'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
    'PAGE_SIZE': 10,

error happened because my IDE also imported pagination.
So, you just need to remove unused imports from settings.py , in my case it looks like:

import os
# import rest_framework.pagination - unnecessary import
from pathlib import Path

@kushalkumarmv
Copy link
Author

when put the right credentials to post request ,it getting an error !
{ "detail": "Authentication credentials were not provided." }
I cross check each codelines ,there is no in error on viewsets.py file of post app

Please @kushalkumarmv , can you provide a cURL of the request you are sending?
http://127.0.0.1:8000/api/auth/login/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants