Re: Function-based Views vs Class-based Views
I would like to recommend this excellent guide by Luke Plant: https://spookylukey.github.io/django-views-the-right-way/ Best regards, Carsten Am 06.03.23 um 21:19 schrieb Michael Starr: > What are the pros and cons of either method of rendering HTTP request > responses? > > https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/ > > In the article above it states that CBVs are DRYer, but I don't understand > why. The article doesn't explain, it just states it. > > The rest of the article is pretty good but it's a pretty slim introduction. > > I thought many of you would like to chime in on this topic. Leave your > opinion below! What do you use? > > Mike -- 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/010ccb6f-bd96-c42a-40cf-b4503708edf6%40cafu.de.
Re: Function-based Views vs Class-based Views
Using classes is always a good way of promoting code usability, and inheritance. With class base views you don't need to reinvent the wheel. You can access other Django classes and methods and reduce code complexity. Although most codes are encapsulated, but you can always go back to the Django source code for review. On Monday, March 6, 2023 at 9:19:21 PM UTC+1 Michael Starr wrote: > What are the pros and cons of either method of rendering HTTP request > responses? > > > https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/ > > In the article above it states that CBVs are DRYer, but I don't understand > why. The article doesn't explain, it just states it. > > The rest of the article is pretty good but it's a pretty slim introduction. > > I thought many of you would like to chime in on this topic. Leave your > opinion below! What do you use? > > Mike > -- 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/d998e837-efcf-4f42-94cb-cc174135d35bn%40googlegroups.com.
Function-based Views vs Class-based Views
What are the pros and cons of either method of rendering HTTP request responses? https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/ In the article above it states that CBVs are DRYer, but I don't understand why. The article doesn't explain, it just states it. The rest of the article is pretty good but it's a pretty slim introduction. I thought many of you would like to chime in on this topic. Leave your opinion below! What do you use? Mike -- 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/7bfa978b-3c11-4509-9160-799e5da43b44n%40googlegroups.com.