【VS Code】設定
阿新 • • 發佈:2022-11-30
1. 基礎命令
- 終端
ctrl ~
- 命令面板
ctrl shift P
2. python 環境配置
- 開啟外掛中心, 安裝 python外掛
- 開啟命令面板, 搜尋
python
選擇Python: Select interpreter
- 進入後選擇 python安裝路徑
- 開啟終端, 新增cmd執行環境
3. django 環境配置
- 開啟外掛中心, 安裝 django外掛
- 開啟終端, 進入python直譯器環境, 安裝 django框架
pip3 install django
- 新增
launch.json
檔案, 選擇Python
-->Django 啟動並除錯 Django Web應用
// launch.json檔案 { // 使用 IntelliSense 瞭解相關屬性。 // 懸停以檢視現有屬性的描述。 // 欲瞭解更多資訊,請訪問: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: Django", "type": "python", "request": "launch", "program": "${workspaceFolder}\\manage.py", "args": [ "runserver", "192.168.20.106:8801", // ip 埠 // "--noreload" // 取消自動重啟 ], "django": true, "justMyCode": true } ] }
4. 隱藏 pycache 資料夾
- 開啟命令列
ctrl shift P
- 輸入
settings
找到open user setting
- 搜尋
files.exclude
- 新增
**/__pycache__
即可