Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added developer debugging tools (#1479) #1508

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

daveoconnor
Copy link
Collaborator

This adds django debug toolbar and a framework for support for debuggers, with a pycharm setup.

Copy link
Collaborator

@GregKaleka GregKaleka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! I'll test this Monday. A few quick thoughts for now.

config/urls.py Outdated Show resolved Hide resolved
config/urls.py Show resolved Hide resolved
pycharm_debugger.py Show resolved Hide resolved
port=12345, # Use the same port number configured in PyCharm
stdoutToServer=True,
stderrToServer=True,
# suspend=True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this option for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've changed that now so it's set better. suspend=True means it stops at breakpoint().

What's really annoying is that by default (suspend=True) the context in your IDE gets moved to this module which takes you away from the code you want to be looking at.
Explicitly setting suspend=False (as I've done now) stops that, it now only stops at the breakpoints set in the gutter.

I've also added an image for the matching pycharm configuration to the docs.

@@ -0,0 +1,3 @@
-c requirements.txt
django-debug-toolbar
pydevd-pycharm==242.23726.102 # pinned to appropriate version for current pycharm
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the argument for pinning this. I can also see an argument for leaving it unconstrained. Either way requires action when any team member upgrades.

Copy link
Collaborator Author

@daveoconnor daveoconnor Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to not pin it, but it's required that it's pinned at the moment.

The issue is pycharm is very picky about the version of pydevd-pycharm it'll work with at any point in time, and as a good example of this, when I first set this up there was a newer version of pydevd-pycharm, but it wasn't compatible with the current version of pycharm and pycharm will complain if you use it... ¯\_(ツ)_/¯

I see now they released another version 2 hours ago so I'll test if that works soon but for now this is compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants