포스트

django를 위한 vscode settings.json

제가 요번에 vscode에서 django를 편하게 사용하기 위해 만든 workspace settings.json입니다.

sticker

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
{
  "workbench.colorTheme": "Default Dark Modern",
  "editor.fontSize": 16,
  "editor.tabSize": 2,
  "editor.indentSize": "tabSize",
  "editor.wordWrap": "wordWrapColumn",
  "editor.wordWrapColumn": 180,
  "editor.formatOnSave": false,
  "explorer.compactFolders": false, // 폴더 경로 전체 표시
  "editor.codeActionsOnSave": {
    "source.organizeImports": "explicit",
    "source.fixAll": "explicit"
  },
  "editor.parameterHints.enabled": false,
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter"
  },
  "black-formatter.args": ["--line-length", "200"],
  "[django-html]": {
    "editor.defaultFormatter": "Shellomo.django-template-intelligence"
  },
  "prettier.printWidth": 180,
  "files.associations": {
    "./**/templates/**/*.html": "django-html",
    "./**/views/**/*.html": "django-html"
  },
  "python.languageServer": "Default",
  "python.analysis.autoImportCompletions": true,
  "sqltools.useNodeRuntime": true, // sqltools를 사용할 경우에만
}

코드에서 타입을 명확하게 해서 타입 에러를 사전에 방지하려면 다음과 같이.

1
2
3
4
5
 "python.languageServer": "Pylance",
 "python.analysis.autoImportCompletions": true,
 "python.analysis.typeCheckingMode": "basic", // 타입 체크 모드
 "python.analysis.useLibraryCodeForTypes": true, // 라이브러리 코드에서 타입 분석

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
32
33
{
  "workbench.colorTheme": "Default Dark Modern",
  "editor.fontSize": 16,
  "editor.tabSize": 2,
  "editor.indentSize": "tabSize",
  "editor.wordWrap": "wordWrapColumn",
  "editor.wordWrapColumn": 180,
  "editor.formatOnSave": false,
  "explorer.compactFolders": false, // 폴더 경로 전체 표시
  "editor.codeActionsOnSave": {
    "source.organizeImports": "explicit",
    "source.fixAll": "explicit"
  },
  "editor.parameterHints.enabled": false,
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter"
  },
  "black-formatter.args": ["--line-length", "200"],
  "[django-html]": {
    "editor.defaultFormatter": "Shellomo.django-template-intelligence"
  },
  "prettier.printWidth": 180,
  "files.associations": {
    "./**/templates/**/*.html": "django-html",
    "./**/views/**/*.html": "django-html"
  },
 "python.languageServer": "Pylance",
  "python.analysis.autoImportCompletions": true,
  "python.analysis.typeCheckingMode": "basic", // 타입 체크 모드
  "python.analysis.useLibraryCodeForTypes": true, // 라이브러리 코드에서 타입 분석
  "sqltools.useNodeRuntime": true, // sqltools를 사용할 경우에만
}

2025-01-13 수정 더 개선된 버전을 만들었습니다. https://blog.naver.com/devramyun/223724890640

[20250113] django vscode settings.json 개선된 버전 지난 번에 작성했던 포스팅에서 보다 보완된 버전으로 새롭게 settings.json을 만들었습니다. 지난번 포스… 지난 번에 작성했던 포스팅에서 보다 보완된 버전으로 새롭게 settings.json을 만들었습니다. 지난번 포스…

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.