Skip to main content

Denis helps you recovering accidentally deleted data from a django project

Project description

https://travis-ci.org/xrmx/django-denis.svg

Denis helps you recovering accidentally deleted data from a django project.

Rationale

Humans make mistakes, sometimes they delete data accidentally from the django admin and you have to spend your afternoon recovering data from a db dump. Sometimes the human is called Denis.

Requirements

  • Django >= 1.6

Installation

  • pip install django-denis

Usage

Given a queryset django-denis finds what the django admin would delete and recover them from a backup database.

Here’s an example session:

$ python manage.py shell
>>> from denis import Denis
>>> from django.contrib.auth.models import User
>>> User.objects.filter(pk=40182)
[]
>>> qs = User.objects.using('backup').filter(pk=40182)
>>> denis = Denis(qs, using='backup')
>>> denis.recover(using='default')
>>> User.objects.using('default').filter(pk=40182)
<User: cicciopasticcio>

The code above assumes a configuration entry called backup for DATABASES in settings.py that should point to a database containing the data you want to recover.

Be cautious

Please always test (and test again) recovery on a copy of your database so you can double check that everything works fine before doing it on your production db.

Of course we don’t take any responsibility with this code. Use at your own risk!

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-denis-0.2.0.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file django-denis-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-denis-0.2.0.tar.gz
Algorithm Hash digest
SHA256 75e79c5d54a4c5a74f36a17590e5b8b8d265a6552cc65b907b72dc6fae55772b
MD5 91fc6a1be832e2ee6c90c87f8ade09e8
BLAKE2b-256 9405e182c4084223dafb94a135db5224086ee9267d91b921f9c4400e429eb4a3

See more details on using hashes here.

Supported by

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