Why Should I use DRF over Django

97 views
Skip to first unread message

Rajprabhu Arulnathan

unread,
Jun 18, 2020, 12:42:49 PM6/18/20
to Django users
Apart from Rest API & serializer why I should use DRF over Django Because We could write what we want in Django & I want to know the advantage of using DRF over Django

Shishir Jha

unread,
Jun 18, 2020, 12:54:50 PM6/18/20
to django...@googlegroups.com
Its not that use drf "over" django. Its like you use drf "with" django. Whenever you want to create rest api, django rest framework is the library created to do that more usually. Django on the other end is a framework to create web application. There is never the case when you are using drf and not django. However you can use django without drf even to create rest apis. If there was something you would choose "over" django, it would be flask. That is a reasonable comparision. Hope this helps.

Thanks and regards,
Shishir Jha

On Thu, 18 Jun 2020, 6:12 pm Rajprabhu Arulnathan, <arulrajp...@gmail.com> wrote:
Apart from Rest API & serializer why I should use DRF over Django Because We could write what we want in Django & I want to know the advantage of using DRF over Django

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/afae9004-3edc-4083-997a-ddfcab647d98o%40googlegroups.com.

Andréas Kühne

unread,
Jun 18, 2020, 1:47:55 PM6/18/20
to django...@googlegroups.com
Like Shishir says it's not using DRF instead of django, It's DRF on top of django.

The main reason for using DRF instead of using django by itself is that you get an enormous consistency. Serialization is really simple, you get validation on all fields with valid JSON results. You get all of the status codes automatically correctly.
All of this can be achieved with Django by itself - but you will need to write a lot of boilerplate code before you get the same functionality that you get from DRF. 

But it's only use is to create a REST API - if you want to have more than that, then you write regular django views.

Regards,

Andréas


maninder singh Kumar

unread,
Jun 18, 2020, 1:58:11 PM6/18/20
to django...@googlegroups.com
DRF causes serialization of data and converts it to JSON, making it an efficient way to communicate with your frontend.  An API allows you to build a common core that can be used on multiple platforms like websites, mobile applications, plugins, and so on.
You can build an API with pure Django too.

regards .. .willy


On Thu, Jun 18, 2020 at 6:12 PM Rajprabhu Arulnathan <arulrajp...@gmail.com> wrote:
Apart from Rest API & serializer why I should use DRF over Django Because We could write what we want in Django & I want to know the advantage of using DRF over Django

--
Reply all
Reply to author
Forward
0 new messages