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

Add optional django-silk #1809

Closed
wants to merge 1 commit into from
Closed

Add optional django-silk #1809

wants to merge 1 commit into from

Conversation

jwhitlock
Copy link
Member

Silk is a live profiling and inspection tool for Django, suitable for local development. It is disabled when DEBUG=False. It is also disabled when running tests, since it adds database queries for writing profile data to the database, using the mechanism suggested at pytest-dev/pytest#9502.

This is based on https://gist.github.com/groovecoder/5d2963d753cdfa690507a415b565dbaa

I'm not convinced we should add it by default, but if you want to use it, this makes it a lot easier.

@netlify
Copy link

netlify bot commented Apr 19, 2022

Deploy Preview for fx-relay-demo canceled.

Name Link
🔨 Latest commit 65e771d
🔍 Latest deploy log https://app.netlify.com/sites/fx-relay-demo/deploys/625e055307aeb30008a4b03d

@netlify
Copy link

netlify bot commented Apr 19, 2022

Deploy Preview for fx-relay-demo canceled.

Name Link
🔨 Latest commit 1fa4c72
🔍 Latest deploy log https://app.netlify.com/sites/fx-relay-demo/deploys/625e0569d695570008db341a

Silk is a live profiling and inspection tool for Django, suitable for
local development. It is disabled when DEBUG=False. It is also disabled
when running tests, since it adds database queries for writing profile
data to the database.
Copy link
Member

@groovecoder groovecoder left a comment

Choose a reason for hiding this comment

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

praise: nice way to clean up code comments and make silk conditional! question on the IN_PYTEST always-fail block.

Comment on lines +26 to +29
# This needs to be before markus, which imports pytest
IN_PYTEST = "pytest" in sys.modules
if IN_PYTEST:
assert 1==2
Copy link
Member

Choose a reason for hiding this comment

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

question: I don't understand why we're doing this? This looks like it's just going to fail everything when we're "in pytest"?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is because I didn't remove my test code from the PR 😅
Also, I should move this branch to the main repo so CI will run the tests.

@jwhitlock
Copy link
Member Author

Replaced by PR #1829.

@jwhitlock jwhitlock closed this Apr 21, 2022
@jwhitlock jwhitlock deleted the add-silk branch April 21, 2022 15:47
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