Django request.user and PyUnresolvedReferences

The user object in a django HttpRequest is not recognized by pycharm. I have hundreds of these in my project, each showing a warning.

Is there a way to:

1) Restrict '# noinspection PyUnresolvedReference' to '# noinspection PyUnresolvedReference request.user' only?

2) Apply a noinspection for request.user on a file by file basis (not a class by class basis, a file by file basis)?

3) Fake pycharm into understanding request.user?

I don't want to disable inspections completely, just this one.

See https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.user
1 comment
Hi,
You may configure it: http://www.jetbrains.com/pycharm/webhelp/resolving-references.html

Actually, PyCharm understands request has user if AuthenticationMiddleware is installed.
0

Please sign in to leave a comment.