Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Denis helps you recovering accidentally deleted data from a django project

Project description

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


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.


  • Django >= 1.6


  • pip install django-denis


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 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 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!

Release history Release notifications

This version
History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-denis-0.2.0.tar.gz (2.8 kB) Copy SHA256 hash SHA256 Source None Nov 23, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page