It really depends .... Architecture vs Performance .... This is what I
usually do. For most of my API implementations, i write function based API
- specially it's a part of a large project where there are multiple
endpoints. I have experienced performance issues using DRF class based
views at multiple occation.

However, if I am using factory design pattern for my model architecture, I
usually choose class based views. That's when I find it extremely useful to
use DRF CBV as you can use reusable serializers.

On Mon., Dec. 23, 2019, 9:41 a.m. Pravin Yadav, <pk.ja...@gmail.com> wrote:

> Hello Everyone,
>
> I'm new beginner in API. Can anyone share which is the best way to create
> the API in DRF.
>
> 1:- Class-Based Views
> 2:- Function based API
> 3:- ViewSets & Routers
>
>
> Kindly suggest which way is best ..
>
>
>
> Thanks & Regards,
> Pravin Kumar Yadav
> 8743064255
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEr6%3DdxZskzhkNvfN5qWJGcTCf-BbNsa-47xnWwxfjz%3DO6MM_w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEr6%3DdxZskzhkNvfN5qWJGcTCf-BbNsa-47xnWwxfjz%3DO6MM_w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAmw3B14dMnYqfO8qZaZQ4HOfNO1Nu9aqAwu%3DFvT7AyaWqvNbg%40mail.gmail.com.

Reply via email to