typeddjango / djangorestframework-stubs

PEP-484 stubs for django-rest-framework
MIT License
439 stars 115 forks source link

Importing from DRF in settings.py raises errors #536

Open johanvergeer opened 8 months ago

johanvergeer commented 8 months ago

Bug report

What's wrong

I am configuring mypy for our project and now I run into some issues with DRF. I attemted to follow #371 and #255 but they keep giving issues at runtime. The issue is not that we get a TypeError: type 'ModelViewSet' is not subscriptable, but all sorts of errors that look like they have to do with importing in settings.py.

The issues I'm facing

How is that should be

I should be able to import DRF classes in settings.py and add them to the django_stubs_ext.monkeypatch extras parameter

System information