Django support sensitive variables
Fix #2356
- Added support for sensitive_variables and sensitive_post_parameter decorators.
- Added test cases
Future Task: Django version 5.0 is expected to support coroutine functions as well. This PR does not add support for it. I will deal with it in a separate PR.
I did check out this error earlier and I was hoping I could get some help resolving. This is an error in test setup, where django is not able to get the view for the route (as shown in the image). The same works in my local (using pytest command for latest django version as well). All views are present (to the best of my knowledge). Tox test case pass for django-v1.11 and below.
Could you help me why the test environment is not able to identify the route ?
Hey @vagi8. Could you try removing/commenting out this test https://github.com/getsentry/sentry-python/blob/master/tests/integrations/django/test_basic.py#L1057 and seeing if the problem persists? I found out in an unrelated PR that that test may be altering the urlconf for other tests, leading to failures. I'll see if I can fix that in another PR.
@sentrivana
All test cases pass when I comment out the said test case. Verified with django-v2.2 and django-v4.1
@vagi8 Thanks for verifying! I've pushed a small commit to your PR to address the broken test case.
@vagi8 Can you please take a look at these?
- the Django Python 2.7 tests are failing: https://github.com/getsentry/sentry-python/actions/runs/6638956405/job/18036359266?pr=2399
- mypy complaining in the lint step: https://github.com/getsentry/sentry-python/actions/runs/6638956425/job/18036360400?pr=2399
@sentrivana hey,
The error is because python2.7 gives out a unicode variable.
The past few hours I have been trying to setup the py2.7 environment locally and it is a pain. Not sure if i did setup correctly, when I run pytest on django i get this error and cant seem to resolve it.
tests/integrations/django/test_basic.py:28: in
from sentry_sdk.integrations.executing import ExecutingIntegration sentry_sdk/integrations/executing.py:17: in raise DidNotEnable("executing is not installed") E DidNotEnable: executing is not installed
tox -e py2.7-django-v1.8 has similar error.
Hey @szokeasaurusrex, Thank you for being patient on the PR. Thanks for the feedback. I resolved everything.
How are we on this @vagi8 ? Is there some time or motivation to bring this over the finish line?
@antonpirker little busy but I can try to spend some time. Any deadline ? We Django 5 released as well so I might have to add support for coroutines too.
We do not have deadlines :-)
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀