-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
settings attributes aren't recorgnized #147
Comments
Can you please:
We had |
The version of django stubs is 1.1.0. A sample of the offending code is:
The settings are defined through
|
Please, try explicitly annotating settings with a type
and let me know if it works. |
@autoferrit did you ever find a solution? I have the exact same setup as you (guessing you also started your project using https://github.com/pydanny/cookiecutter-django) and I'm getting the same "Name 'settings.AUTH_USER_MODEL' is not defined" errors. |
Hi, I can't help with the original report raised but for the I've also been getting these errors and they appear to be in the user tests which look like:
Is it possible that Another problem with cookiecutter-django tests above comes from |
Why won't you use the real type here? |
For UPD. Oh, sorry, I think I got the context a bit wrong.
I can look into it if it's useful for you. |
Just to be clear: User = get_user_model()
def func(u: User):
pass currently does not work as @mkurnikov said. Currently |
The cookiecutter-django errors should be gone in future releases with cookiecutter/cookiecutter-django#2396 now merged. It now explicitly checks against |
I have the same issue with
|
This is still totally broken. Last working release is |
1.16.0 still broken |
|
Does the See README: How to use a custom library to handle Django settings? It was introduced in django-stubs 4.2.2 (#1557) |
Seems it really fix the issue. |
Thanks for confirming, I'll close this issue. |
When I run mypy, it complains that the Settings object does not have certain attributes. I'm running mypy with
PYTHONPATH
set correctly and I specified the settings module in my mypy.ini.mypy command:
mypy.ini:
mypy output:
The text was updated successfully, but these errors were encountered: