0

There are so many names with 'generic' in it , i.e.- generic view etc. What does it means and how different are these from 'regular' views or urls ?

ancho
  • 1,060
  • 16
  • 24

2 Answers2

2

From the django docs:

https://docs.djangoproject.com/en/dev/topics/class-based-views/generic-display/

Django’s generic views were developed to ease that pain. They take certain common idioms and patterns found in view development and abstract them so that you can quickly write common views of data without having to write too much code.

They created for simplifying developing process, because many things are the same from the project to project and with them don't need write annoying stuff again and again.

And "regular" are views which implements your business-logic, so it can not be generic.

coldmind
  • 5,167
  • 2
  • 22
  • 22
0

The docs describe the difference between Base and Generic views pretty well:

Base class-based views can be thought of as parent views, which can be used by themselves or inherited from. They may not provide all the capabilities required for projects, in which case there are Mixins which extend what base views can do.

Django’s generic views are built off of those base views, and were developed as a shortcut for common usage patterns such as displaying the details of an object. They take certain common idioms and patterns found in view development and abstract them so that you can quickly write common views of data without having to repeat yourself.

rnevius
  • 26,578
  • 10
  • 58
  • 86