Command to generate password hashes from commandline.

This commit is contained in:
Jim Driessen
2017-01-21 23:04:00 +01:00
parent 6256629140
commit 4a1a74b22e

View File

@ -0,0 +1,11 @@
import getpass
from django.core.management.base import BaseCommand
from django.contrib.auth.hashers import make_password
class Command(BaseCommand):
help = 'Generate hash for a password (or player token).'
def handle(self, *args, **options):
password = getpass.getpass()
print(make_password(password))