Note that if you make any changes to the code, Django will restart and that will disconnect the debugger, so you’ll have to reconnect. To attach the debugger to the LMS process that’s always running in the container, just hit Debug > Start Debugging or press F5. You will now have python Intellisense, linting, and debugging with breakpoints and local variables working! (At least for the LMS for Studio, repeat as needed). Find the Python Extension in the “Local – Installed” panel, and click “Install on Attached Container”Īnd you are now ready to start developing and debugging. Note that most of your extensions are not available yet. Click on the Extensions tab of VS Code on the left of the window. We’ll also need to install the Python extension inside the container. Open the workspace created earlier by choosing File > Open Workspace and open /edx/app/edxapp/edx-platform/.vscode/de-workspace Now we will be working on this VSCode window. This will open a new Visual Studio Code window, this time running inside the LMS container. Now Press F1 to open the Command Palette, and choose Remote-Containers: Attach to Running Container… If os.environ.get('RUN_MAIN') or os.environ.get('WERKZEUG_RUN_MAIN'): Then we need to install the debugger package into the edxapp venv: The first step is to install the Remote – Containers VS Code extension (or the Remote Development Pack if you also want the SSH remote extension) and start up your Open edX devstack (make dev.up) if it’s not already running. Make sure VS Code is up to date (the beta/insiders build is not required anymore, but you do need the latest release) This will give you as-you-type auto-completion of most python code, near-real-time pylint linting using edX®’s linting rules, and the ability to step through edxapp’s execution and pause and inspect variables while it runs. With recent changes to Visual Studio Code, it’s now possible for VS Code users to get Intellisense and debugging working with your containerized devstack LMS. The move to using Docker for the Open edX® devstack brought many improvements to our workflow, but it isn’t obvious how to use a key developer tool with the Docker-based devstack: a python debugger. A technical tutorial brought to you by OpenCraft : ) This article was written by team member Paulo Viadanna.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |