HTTP/1.0 201 Created
"POST /texts/texts/ HTTP/1.1" 403 58
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
It is not enought that you send token as a cookie, you need to send cookie value as part of the POST request as well.
Django uses X-CSRFToken header in AJAX calls. You could use
normal POST variable if you're using normal form encoded POST, but
usually with DRF you send something like JSON where it's not
possible to embed CSRF token.
See https://docs.djangoproject.com/en/1.10/ref/csrf/#ajax for
more information and example with jQuery.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Jani Tiainen
function getCookie(name) {
var csrftoken = getCookie('csrftoken');
var csrftoken = Cookies.get('csrftoken');
The number of GET/POST parameters exceeded settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
[26/Jan/2017 14:21:57] "POST /texts/texts/ HTTP/1.1" 400 16803
ValueError: Cannot assign "<django.contrib.auth.models.AnonymousUser object at 0x108eb2208>": "Texts.owner" must be a "User" instance.
[26/Jan/2017 17:07:36] "POST /texts/texts/ HTTP/1.1" 500 17052