how to use django restframework as a backend for mobile apps -
i need built "api". using django restframework. api has support multiple platforms mobile apps, webapps. api used backend store information. problem how access users information using api. mean django has user model. , access user related stuff using request.user. how access request.user information using api. please pardon me asking such question. new developing api mobile apps. facing difficulty.
i think easiest way think it, django rest framework (normally) return or process json data, rather html page / html form data.
your models stay same.
if use django's modelforms drf's modelserialzers similar in use.
likewise, using django's class based generic views, similar drf's generic views similar - except rather processing post data html forms, receive json data. generic views cover same things - create via post, update via put, delete via delete.
like main difference dealing json in place of html.
(you use bog standard django views without rest-framework , return or process json. drf takes fair bit of boilerplate code out of process).
Comments
Post a Comment