Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

melius

[VS Code] Django pylint(no-member) error 본문

et cetera

[VS Code] Django pylint(no-member) error

melius102 2020. 7. 10. 16:21

VS Code로 Django 앱 개발시, 실제 코드 동작에는 문제가 없으나, VS Code의 pylint가 model 클래스의 몇몇 속성을 인식하지 못하는 문제로 pylint(no-member) 에러 메시지(코드상 빨간 밑줄)를 발생시킨다. 이를 해결하기 위해서 pylint_django 모듈을 설치한다.

 

pip install pylint-django

 

settings.json 파일에 아래 설정을 추가한다.

 

{
    "python.linting.pylintArgs": [
        "--load-plugins=pylint_django",
        "--disable=C0111,W0611" // "--errors-only"
    ]
}

 

"--disable=C0111,W0611" 은 추가적으로 발생한 경고문을 disable 시킨다. 관련 경고코드 설명은 아래의 pylint.pycqa.org 사이트를 참고하면 된다.

 

 

references

ssungkang.tistory.com/entry/Django-class-has-no-objects-member-%EC%97%90%EB%9F%AC

stackoverflow.com/questions/45135263/class-has-no-objects-member

pylint.pycqa.org/en/latest/technical_reference/features.html

https://code.visualstudio.com/docs/python/linting

 

 

'et cetera' 카테고리의 다른 글

[Chrome] 유용한 기능  (0) 2020.09.01
[CMD] 파일검색  (0) 2020.08.17
[Git] 고급 사용법  (0) 2020.03.04
[real estate] 부동산 분석  (0) 2020.02.20
[real estate] 집합건물법  (0) 2020.02.20
Comments