Skip to content

LOGIN_URL declared as _StrOrPromise, should be just str #2867

@alexei

Description

@alexei

LOGIN_URL is declared as _StrOrPromise in django-stubs/conf/global_settings.pyi. But according to the docs at https://docs.djangoproject.com/en/5.2/ref/settings/#login-url it should be a str:

The URL or named URL pattern where requests are redirected for login

Even internally it's passed to django.shortcuts.resolve_url (see source code for user_passes_test). When I do it (resolve_url(settings.LOGIN_URL)), I get:

Argument 1 to "resolve_url" has incompatible type "str | _StrPromise"; expected "Callable[..., Any] | Model | str"
  • python version: 3.11.12
  • django version: 5.2.7
  • mypy version: 1.13.0
  • django-stubs version: 5.2.7

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