Using VS Code I stumbled into this error raised by django-pyling:
Whenever I write:
from django.contrib.auth.models import User
Django-Pylint return me this error:
User model imported from django.contrib.auth.models
Apparently there are a lot of ppl experiencing the same errors on Stack Overflow (sorry can’t post url due to new user’s link limits)
and on Pylint repo, they also somehow criticize Django documentations, saying that the documentations contradict itselfs and
FTR Django doesn't always document or even follow its practices.
01:40AM - 02 Aug 20 UTC
10:16AM - 04 Aug 20 UTC
I'm getting an error and I don't know why it is showing up.
It is a
I am wondering:
I am referring and using Django 4
Thanks for clarification!
Django does say to use
only when building reusable apps - i.e. those intended for use in multiple projects, installed via PyPI or similar.
This is covered under the heading
Reusable apps and in the docs.
pylint-django is somewhat mistaken in always recommending this. If you are building a normal Django project you
do not need to use
The Django docs could perhaps be reworded to reiterate this.
Edit: Opened an issue in pylint-django to modify the check.
loved your precision and your effort in helping me understand what’s the right use of Django!
I’m going to toss in an additional thought here, too.
When we want to extend User, we rely upon the User Profile pattern. (See the second paragraph at
Extending the existing .)
Of the dozen or so Django applications I manage, only one changes the User model - and about half the time I regret
that decision. In all other cases, one (or more) profile models are used to store related information about a user.
(I’m actually of the belief that the current User model is already too bloated and would be improved if it were slimmed down even farther.)