1

I answered an exam that states a Django's view is not necessarily a Python's function.

But,in Django's documentation (https://docs.djangoproject.com/en/1.8/topics/http/views/) it is stated that a view is simply a Python's function.

What else could a view be made of?

Vitor
  • 367
  • 3
  • 12

1 Answers1

4

It could be any callable. That is e.g. class with __call__ method implemented. Check django's documentation for class based views.

Also check this question to get the idea what is callable.

Community
  • 1
  • 1
beezz
  • 2,398
  • 19
  • 15