Skip to content

Commit 0e4d14e

Browse files
authored
Adding dev container and updating configs (microsoft#95)
* Adding dec container and updating configs * Update .devcontainer/devcontainer.json
1 parent e792293 commit 0e4d14e

File tree

3 files changed

+51
-107
lines changed

3 files changed

+51
-107
lines changed

.devcontainer/devcontainer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python VS Code Flask Tutorial",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
"postCreateCommand": "pip3 install --user -r requirements.txt",
16+
17+
// Configure tool-specific properties.
18+
"customizations": {
19+
"vscode": {
20+
"extensions": [
21+
"ms-python.python",
22+
"ms-python.black-formatter",
23+
"ms-python.vscode-pylance",
24+
"charliermarsh.ruff",
25+
"ms-python.debugpy"
26+
]
27+
}
28+
}
29+
30+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
31+
// "remoteUser": "root"
32+
}

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly

.vscode/launch.json

Lines changed: 7 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -5,121 +5,21 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "Python: runserver.py",
9-
"type": "python",
10-
"request": "launch",
11-
"program": "${workspaceFolder}/runserver.py",
12-
},
13-
{
14-
"name": "Python: Current File",
15-
"type": "python",
16-
"request": "launch",
17-
"program": "${file}",
18-
"env": {
19-
"FLASK_ENV": "development"
20-
}
21-
},
22-
{
23-
"name": "Python: Attach",
24-
"type": "python",
25-
"request": "attach",
26-
"localRoot": "${workspaceFolder}",
27-
"remoteRoot": "${workspaceFolder}",
28-
"port": 3000,
29-
"secret": "my_secret",
30-
"host": "localhost"
31-
},
32-
{
33-
"name": "Python: Terminal (integrated)",
34-
"type": "python",
35-
"request": "launch",
36-
"program": "${file}",
37-
"console": "integratedTerminal"
38-
},
39-
{
40-
"name": "Python: Terminal (external)",
41-
"type": "python",
42-
"request": "launch",
43-
"program": "${file}",
44-
"console": "externalTerminal"
45-
},
46-
{
47-
"name": "Python: Django",
48-
"type": "python",
49-
"request": "launch",
50-
"program": "${workspaceFolder}/manage.py",
51-
"args": [
52-
"runserver",
53-
"--noreload",
54-
"--nothreading"
55-
],
56-
"debugOptions": [
57-
"RedirectOutput",
58-
"Django"
59-
]
60-
},
61-
{
62-
"name": "Python: Flask (0.11.x or later)",
63-
"type": "python",
8+
"name": "Python Debugger: Flask",
9+
"type": "debugpy",
6410
"request": "launch",
6511
"module": "flask",
6612
"env": {
67-
"FLASK_APP": "hello_app.webapp"
13+
"FLASK_APP": "hello_app.webapp",
14+
"FLASK_DEBUG": "1"
6815
},
6916
"args": [
7017
"run",
7118
"--no-debugger",
72-
"--no-reload" // Remove to auto-reload modified pages
73-
]
74-
},
75-
{
76-
"name": "Python: Module",
77-
"type": "python",
78-
"request": "launch",
79-
"module": "module.name"
80-
},
81-
{
82-
"name": "Python: Pyramid",
83-
"type": "python",
84-
"request": "launch",
85-
"args": [
86-
"${workspaceFolder}/development.ini"
87-
],
88-
"debugOptions": [
89-
"RedirectOutput",
90-
"Pyramid"
91-
]
92-
},
93-
{
94-
"name": "Python: Watson",
95-
"type": "python",
96-
"request": "launch",
97-
"program": "${workspaceFolder}/console.py",
98-
"args": [
99-
"dev",
100-
"runserver",
101-
"--noreload=True"
102-
]
103-
},
104-
{
105-
"name": "Python: All debug Options",
106-
"type": "python",
107-
"request": "launch",
108-
"pythonPath": "${config:python.pythonPath}",
109-
"program": "${file}",
110-
"module": "module.name",
111-
"env": {
112-
"VAR1": "1",
113-
"VAR2": "2"
114-
},
115-
"envFile": "${workspaceFolder}/.env",
116-
"args": [
117-
"arg1",
118-
"arg2"
19+
"--no-reload"
11920
],
120-
"debugOptions": [
121-
"RedirectOutput"
122-
]
21+
"jinja": true,
22+
"justMyCode": true
12323
}
12424
]
12525
}

0 commit comments

Comments
 (0)