set master pwd al primo lancio - ruoli

This commit is contained in:
2025-02-02 16:35:34 +01:00
parent e3ae8300f1
commit 2d172a3620
16 changed files with 174 additions and 168 deletions

10
wallet_api/signals.py Normal file
View File

@@ -0,0 +1,10 @@
from django.db.models.signals import post_migrate
from django.dispatch import receiver
from dotenv import dotenv_values
from .utils import authenticate
@receiver(post_migrate)
def init_master_passwored(sender, **kwargs):
if sender.name == 'wallet_api':
config = dotenv_values(".env")
authenticate(config['MASTER_PASSWORD'])