Skip to main content

Globally censor a set of default variable names in your Django error reports

Project description

extra_sensitive_variables is a third-party exception filter for Django. This allows you to globally censor a set of default variable names in Django’s error reports regardless of a function’s lack of @sensitive_* decorators. Basically, any variable matching the names provided in settings.EXTRA_SENSITIVE_VARIABLES or settings.EXTRA_SENSITIVE_POST_PARAMETERS will be censored.

Installation

  1. Install the package via pip

    pip install django-extra-sensitive-variables
  2. Tell Django to use the Extra Sensitive Variable filter by overriding DEFAULT_EXCEPTION_REPORTER_FILTER in your settings.py

    DEFAULT_EXCEPTION_REPORTER_FILTER = 'extra_sensitive_variables.ExtraSensitiveReporterFilter'
  3. Then add the following variables to your settings.py and modify them as you see fit

    # Variable names to always censor from "local vars" output
    EXTRA_SENSITIVE_VARIABLES = ['password', 'credentials']
    
    # Censor anything from the POST QueryDict matching these names
    EXTRA_SENSITIVE_POST_PARAMETERS = ['password', 'credentials', 'credit_card_number']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-extra-sensitive-variables-1.0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_extra_sensitive_variables-1.0.2-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-extra-sensitive-variables-1.0.2.tar.gz.

File metadata

File hashes

Hashes for django-extra-sensitive-variables-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9c12d124c17aaecf5b892f3083827027831f378039a9348714b939d47eef8e13
MD5 e6c027467d6b8abdd5693095fd7a4c69
BLAKE2b-256 6b3bcbfcaceb0eb28aa0a3f9debad70ad7d17cbb4a1ebc0770a861f195ae6a0c

See more details on using hashes here.

File details

Details for the file django_extra_sensitive_variables-1.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_extra_sensitive_variables-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 70f4c42673386b407075490840522d511da3e1347a7acbb4b7a01a22a88d5811
MD5 377a15bb241eba5f3959f8a5dc244081
BLAKE2b-256 51519e05fea4a660ea264c81a8b4ddb6b1a6b3f711d7fee6ec6c01334612a513

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page