зеркало из https://github.com/mozilla/treeherder.git
Enable pdb in a docker container (#6159)
Add config changes to docker-compose file to support pdb and update docs
This commit is contained in:
Родитель
bda34885b1
Коммит
fbd8c4cc23
|
@ -41,6 +41,8 @@ services:
|
|||
- mysql
|
||||
- redis
|
||||
- rabbitmq
|
||||
stdin_open: true
|
||||
tty: true
|
||||
|
||||
frontend:
|
||||
container_name: frontend
|
||||
|
|
|
@ -41,3 +41,11 @@ To add a new repository, the following steps are needed:
|
|||
|
||||
For more information on adding a new GitHub repository, see
|
||||
[Adding a GitHub repository](submitting_data.md#adding-a-github-repository).
|
||||
|
||||
## Debugging Tools
|
||||
|
||||
You can use the Python Debugger ([pdb](https://docs.python.org/3.7/library/pdb.html)) in a Docker container.
|
||||
After starting a local Treeherder instance using [docker-compose](installation.md#server-and-full-stack-development),
|
||||
in a separate shell type `docker attach backend`. Then set a breakpoint in your file using either `import pdb; pdb.set_trace()`
|
||||
or `breakpoint()` (for Python v3.7+). The pdb debugger will start in that shell once the breakpoint has been triggered.
|
||||
For example, it can be triggered via refreshing the browser (localhost) if the view you're on calls an API with a breakpoint on it.
|
||||
|
|
Загрузка…
Ссылка в новой задаче