Hi,

Have you checked from your browser debugging tools (network tab or similar)
what's the body of the response? it should tell more detailed reason of an
error.

Convenient place would be views dispatch() method where most of the magic
happens, though usually it's enough to check response body in browser,

My educated guess is that you're missing CSRF token when doing POST.

On Wed, Jan 25, 2017 at 4:39 PM, Bob Aalsma <[email protected]>
wrote:

> Hi,
>
> I'm new to Django Rest Framework (and new to Javascript), not new to
> Python, not really now to Django.
>
> I've created a Javascript that should send a POST request to
> localhost/Django Rest framework app.
>
> I've copied the contents of the message from Javascript console.log into
> the Rest API html - OK
> I've copied the message to a POST through http - OK:
>
> HTTP/1.0 201 Created
>
> BUT when I send the POST from the Javascript to the server, it says
>
> "POST /texts/texts/ HTTP/1.1" 403 58
>
> So I'd want to get a closer look at what happens with the incoming message
> and I'd normally put a "import ipdb; ipdb.set_trace()" at a convenient
> place.
> And now I discover that I still don't understand enough of this framework
> to decide on "a convenient place"...
> Please help.
>
> Regards,
> Bob
>
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to