Open deirdreamuel opened 1 month ago
Interesting! So it looks like getattr(view, item)
fails even though it should by definition succeed. dir(view)
gets all the attribute names right there and thus they should alle be getattr
-able, unless you have a custom __dir__
implementation on the the view.
However, since uvicorn et al do not even remotely go there, I cannot really understand why your dev/prod behaves differently, unless there is other things going on, you are not realizing.
A quick google search on __provides__
only gave some results on zope. Are you using that? Apart from that, this does not seem to be a common dunder method.
@tfranzel please look into https://github.com/twisted/twisted codebase. We are having the same issue and can be backtracked there: https://github.com/scrapy/scrapy/issues/6307#issuecomment-2042341378
Related issues:
I assume we should apply the same fix, do not rely that all methods/attributes returned by dir
are available always, mentioned here: https://docs.python.org/3.10/library/functions.html#dir
Describe the bug There is an issue with drf_spectacular's
@extend_schema_view
that is only happening in production server i.e. Daphne, Gunicorn, Uvicorn. This issue does not happen withpython manage.py runserver
. The server does start up with daphne after removing all@extend_schema_view
decorators.Sample logs using Daphne:
To Reproduce I have something sort of the following for different views under
/views
dir.Expected behavior The application should work and start without problems the same way it starts with
python manage.py runserver