AuthToken: ability to create using a command

This commit is contained in:
Klaas van Schelven
2025-04-11 14:45:37 +02:00
parent 294105170b
commit 485df1aed9

View File

@@ -0,0 +1,11 @@
from django.core.management.base import BaseCommand
from bsmain.models import AuthToken
class Command(BaseCommand):
help = "Creates an auth_token and prints it on screen"""
def handle(self, *args, **options):
auth_token = AuthToken.objects.create()
print(auth_token.token)