mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 22:12:22 +01:00
Command to generate password hashes from commandline.
This commit is contained in:
11
marietje/marietje/management/commands/passwordhash.py
Normal file
11
marietje/marietje/management/commands/passwordhash.py
Normal 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))
|
||||||
Reference in New Issue
Block a user