Post Requets not working CSRF Failed: CSRF token missing. #9246
-
I try using Django Restframework together with VueJS and axion. But my Header in the frontend looks correct. And in the developer tools the cockie is correct loading into the header. my csrf settings in django settings.py CSRF_COOKIE_NAME = "csrftoken" I have no problems with the get requests. Only than it come to POST, PUT, DELETE. Thank you for your advice. With regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
is the CSRF middleware included in Django project's MIDDLEWARE = [
...
'django.middleware.csrf.CsrfViewMiddleware',
...
] |
Beta Was this translation helpful? Give feedback.
-
I was banging my head on the table for 2 hours! 😹
…On Sat, Oct 5, 2024, 11:43 AM Bereket Getachew ***@***.***> wrote:
tnx mate I think I was having the same problem when I changed the browser
it worked like a charm😌
—
Reply to this email directly, view it on GitHub
<#9246 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3QT4WJJOPH2JX7ZDQAF423ZZ6NR5AVCNFSM6AAAAABCURPDFGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOBVGA4DINA>
.
You are receiving this because you commented.Message ID:
<encode/django-rest-framework/repo-discussions/9246/comments/10850844@
github.com>
|
Beta Was this translation helpful? Give feedback.
Hi, there was a cache problem in my Browser or so. So the HTTP Only Attribute was still set to true. Because of this my Java Script client could not use the Csrf toke.