BetterWorks / django-anonymizer

MIT License
14 stars 12 forks source link

================== Django Anonymizer

.. image:: https://travis-ci.org/BetterWorks/django-anonymizer.svg?branch=master :target: https://travis-ci.org/BetterWorks/django-anonymizer

.. image:: https://codecov.io/github/BetterWorks/django-anonymizer/coverage.svg?branch=master :target: https://codecov.io/github/BetterWorks/django-anonymizer?branch=master

This was originally a fork of https://bitbucket.org/spookylukey/django-anonymizer/

Intro

This app helps you anonymize data in a database used for development of a Django project.

It is common practice in develpment to use a database that is very similar in content to the real data. The problem is that this can lead to having copies of sensitive customer data on development machines. This Django app helps by providing an easy and customizable way to anonymize data in your models.

The basic method is to go through all the models that you specify, and generate fake data for all the fields specified. Introspection of the models will produce an anonymizer that will attempt to provide sensible fake data for each field, leaving you to tweak for your needs.

Please note that the methods provided may not be able to give full anonymity. Even if you anonymize the names and other details of your customers, there may well be enough data to identify them. Relationships between records in the database are not altered, in order to preserve the characteristic structure of data in your application, but this may leave you open to information leaks which might not be acceptable for your data. This application should be good enough for simpler policies like 'remove all real telephone numbers from the database'.

An alternative approach to the problem of realistic amounts of test data for development/tests is to populate a database from scratch - see django-poseur <https://github.com/alliterativeanimal/django-poseur>, django-mockups <https://github.com/sorl/django-mockups> and django-autofixture <https://github.com/gregmuellegger/django-autofixture>_. The disavantage of that method is that the structure of the data - in terms of related models - can be unrealistic.

Usage

Quick overview (see docs for more information, either in docs/ or on http://packages.python.org/django-anonymizer).

Tests

To run the test suite, do the following inside the folder containing this README::

django-admin.py test --settings=anonymizer.test_settings