[Django]-How to pass args to a signal

1๐Ÿ‘

โœ…

Sending signals

There are two ways to send send signals in Django.

Signal.send(sender, **kwargs)

Signal.send_robust(sender, **kwargs)

https://docs.djangoproject.com/en/dev/topics/signals/#sending-signals

In your case, you may do something like this

# not the real word code.
Signal.send(User, raw_password="xxx")

# raw password stays in **kwargs

def create_user_profile(sender, instance, created, **kwargs):

if created:
      //here i want user password unencrypted where I pass that parameter to this
      raw_pass = kwargs.get('raw_password')
๐Ÿ‘คxiaowl

Leave a comment