-
Notifications
You must be signed in to change notification settings - Fork 36
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 check for debug true in Django #142
base: master
Are you sure you want to change the base?
Added check for debug true in Django #142
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
) | ||
) | ||
) @avoid_django_debug_true | ||
inculde: ["**/settings.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in include
field name
) | ||
) | ||
) @avoid_django_debug_true | ||
include: ["**/settings.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work on the analysis runtime given the way the test runner is implemented. Since we look for an individual file rule-name.test.extension
, settings.py
will never match the pattern. Here is the related issue: #159.
# <expect-error> | ||
DEBUG = True | ||
# <no-error> | ||
DEBUG = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even the first DEBUG, in line no. 2, should not raise an issue, since it is overwritten in line no. 4. You'd have to implement the checker in Go in order to check for the last DEBUG
. You might also want to look for DEBUG
statements inside conditional blocks.
DEBUG = True cannot be used in production in django framework.
When DEBUG = True is enabled in Django, the framework provides detailed error messages, stack traces, and sensitive information about your application. While useful for development, this setting is dangerous in production because:
❌ Risks of DEBUG = True in Production
Sensitive Data Exposure
Security Vulnerabilities
Performance Issues