dummy_passwords.py 363 Bytes
# -*- coding: utf-8 -*-

from django.contrib.auth.models import User
from django.core.management.base import BaseCommand

class Command(BaseCommand):
  args = 'none'
  help = 'Sets dummy passwords'

  def handle(self, **options):
    dummy_passwords()


def dummy_passwords():
  for user in User.objects.all():
    user.set_password(user.username)
    user.save()