Skip to content

Instantly share code, notes, and snippets.

@alsedev
alsedev / actions.py
Created January 21, 2020 20:02 — forked from ahmontero/actions.py
Trace the changes made to a django model. You can see how to use it in example.py
# -*- encoding: utf-8 -*-
# --------------------------
# Ripped from django project
# --------------------------
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from django.utils.encoding import force_unicode
@alsedev
alsedev / postgres_manager.py
Created October 11, 2019 03:25 — forked from valferon/postgres_manager.py
Python script to take care of postgres backup and restore of data
#!/usr/bin/python3
import argparse
import logging
import subprocess
import os
import tempfile
from tempfile import mkstemp
import configparser
import gzip