django-examples icon indicating copy to clipboard operation
django-examples copied to clipboard

adding quote

Open mwaaas opened this issue 11 years ago • 9 comments

when adding quote it does not add to the database. something to do with authorization . how does authorization work for django models

mwaaas avatar Aug 14 '14 13:08 mwaaas

Can you check in firebug or chrome JS console what the request is doing - an exception or something maybe?

riklaunim avatar Aug 14 '14 22:08 riklaunim

this is the erro I get from the chrome js console ailed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR) http://localhost:8000/api/v1/quote/

mwaaas avatar Aug 19 '14 08:08 mwaaas

enable debug and check what is the exception there.

riklaunim avatar Aug 19 '14 18:08 riklaunim

sorry the error code was 401. Not authenticated.

how does one authenticate the request so that it can add the quote to the database

mwaaas avatar Aug 19 '14 19:08 mwaaas

If I remember that demo correctly - just login in django admin panel for it to have authentication.

riklaunim avatar Aug 19 '14 19:08 riklaunim

wow it has worked. Am still learning ember . and this demo as given has been of good help thanks

mwaaas avatar Aug 19 '14 19:08 mwaaas

I'm planning to publish something newer and more detailed with django-rest-framework :)

riklaunim avatar Aug 19 '14 20:08 riklaunim

thats nice . which rest framework do you prefer django-rest or tastpie

mwaaas avatar Aug 20 '14 02:08 mwaaas

DRF seems to be now the leader / better than tastypie.

riklaunim avatar Aug 20 '14 06:08 riklaunim