riklaunim / django-examples

Example and demo apps for Django web framework
MIT License
15 stars 10 forks source link

adding quote #2

Open mwaaas opened 10 years ago

mwaaas commented 10 years ago

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

riklaunim commented 10 years ago

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

mwaaas commented 10 years ago

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/

riklaunim commented 10 years ago

enable debug and check what is the exception there.

mwaaas commented 10 years ago

sorry the error code was 401. Not authenticated.

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

riklaunim commented 10 years ago

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

mwaaas commented 10 years ago

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

riklaunim commented 10 years ago

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

mwaaas commented 10 years ago

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

riklaunim commented 10 years ago

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