set master pwd al primo lancio - ruoli
This commit is contained in:
10
wallet_api/signals.py
Normal file
10
wallet_api/signals.py
Normal 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'])
|
||||
Reference in New Issue
Block a user