Data Masker is a simple Django app to do data masking. It masks sensitive data by name of form fields and is highly configurable. Currently CharField and EmailField are supported.
Quick start
Add data_masker to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'data_masker', ]In template, pass the form which contains sensitive data to mask_form tag before any rendering tags.
Example template
{# Load the tag library #} {% load data_masker %} {# Display a form #} <form action="/url/to/submit/" method="post" class="form"> {% csrf_token %} {# Mask the form #} {% mask_form form as masked_form %} {{ masked_form }} {# It also works well with django-bootstrap #} {% comment %} {% bootstrap_form masked_form %} {% endcomment %} <button type="submit">Submit</button> </form>
Settings
django-data-masker has some pre-configured settings which can be modified by adding variables with DATA_MASKER_ prefix in your settings.py and customizing the values you want.
Variable |
Usage |
Default |
|---|---|---|
DATA_MASKER_CLEAR_HEADING |
Number of heading characters to leave untouched |
2 |
DATA_MASKER_CLEAR_TAILING |
Number of tailing characters to leave untouched |
2 |
DATA_MASKER_MASK_FULL_EMAIL |
Mask full email address including domainname part |
False |
DATA_MASKER_FIELD_LIST |
List of field name to mask |
[‘account_name’, ‘account_number’, ‘email’] |
Release files for django-data-masker 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-data-masker-1.1.1.tar.gz | 4.3 kB | Details |
Release files / django-data-masker-1.1.1.tar.gz
| Download URL | django-data-masker-1.1.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64a23ff67a7934ed94cf355ed03f1a9debdbca8d5b163ccca4d300d1b0d77c68
|
|
BLAKE2b-256 checksum How to use checksums |
5a434a9727ee4d32b0436d7710a4d81905c42da79dadbe1bac689b884c7f9ab5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
|