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

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


class Command(BaseCommand):
    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()