I can't see why not - as far as Python is concerned a callable is a callable.
There is a deep in the weeds way for a caller to determine if a callable is a __call__ method on a class, but I really doubt Django does anything close to that - what would be the benefit. On Wed, May 15, 2024 at 8:39 PM Christophe Pettus <[email protected]> wrote: > Hi, > > I'm surprised I don't know this, but: Can a view "function" in a urlconf > be a callable that is not actually a function, such as a class with a > __call__ method? > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/F70DCB4E-1307-42C2-AC62-CA2DC98DCD5B%40thebuild.com > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN0Bb7fx5t1FC5WKRwkE31%3DYvnTVRoSi_hYqDB%2B%3DZG2-7zonzg%40mail.gmail.com.

