Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View s4n7h0's full-sized avatar

Sanoop Thomas s4n7h0

View GitHub Profile
@s4n7h0
s4n7h0 / django-clean-migrate.sh
Last active May 10, 2021 16:16
Bash script to clean up django migration
#!/bin/sh
# This script is for cleaning up django migration
echo "Starting to clean up..."
# when deleting old migration, ensure not to delete the files under /django/db/migrations/
echo ">> Deleting old migrations"
find . -path "*/migrations/*.py" -not -path "*/venv/*" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -not -path "*/venv/*" -delete
# utils for slug generator
import random
import string
from django.utils.text import slugify
def random_string_generator(size=10, chars=string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))

Keybase proof

I hereby claim:

  • I am s4n7h0 on github.
  • I am s4n7h0 (https://keybase.io/s4n7h0) on keybase.
  • I have a public key ASBbU2HlT7KVmWpC-VXzUsSYLQxqGhORXBNIOfevb-4hAgo

To claim this, I am signing this object: