Skip to content

Importing from DRF in settings.py raises errors #536

Open
@johanvergeer

Description

@johanvergeer

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

  • OS: Windows
  • python version: 3.11
  • django version: 4.2.7
  • mypy version: 1.6.1
  • django-stubs version: 4.2.6
  • djangorestframework version: 3.14.0
  • djangorestframework-stubs version: 3.14.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions