Skip to content

Dynamic settings fail as of 1.13.0 #1276

@markedwards

Description

@markedwards

Bug report

What's wrong

We build Django settings dynamically, instead of using a settings.py file with static properties. This worked fine with django-stubs up until 1.13.0, but all of our settings fail with 1.13.0:

'Settings' object has no attribute 'FOO'

This seems to be caused by #1163.

How is that should be

I understand the reasoning given in #1163, but we are pinned at django-stubs 1.12.0 and would have to completely reimplement our installation in order to unblock. Can dynamically-constructed settings be supported with django-stubs, or is that door permanently closed? Maybe it could be a non-default option we could enable, accepting the potential downsides?

System information

  • OS:
  • python version: 3.10.8
  • django version: 4.1.3
  • mypy version: 0.991
  • django-stubs version: 1.13.0
  • django-stubs-ext version: 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginregressionBehavior has changed for worse with a release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions