# !/usr/bin/python
# -*- coding: utf-8 -*-
"""
    Author: <NAME>
    Contact: <EMAIL> or <EMAIL>
    File: signals.py
    Time: 2020/8/23 18:06
    File Intro: 
"""

from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth import get_user_model

User = get_user_model()


@receiver(post_save, sender=User)
def create_user(sender, instance=None, created=False, **kwargs):
    if created:
        password = <PASSWORD>
        instance.set_password(password)
        instance.save()

# !/usr/bin/python
# -*- coding: utf-8 -*-
"""
    Author: <NAME>
    Contact: <EMAIL> or <EMAIL>
    File: signals.py
    Time: 2020/8/23 18:06
    File Intro: 
"""

from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth import get_user_model

User = get_user_model()


@receiver(post_save, sender=User)
def create_user(sender, instance=None, created=False, **kwargs):
    if created:
        password = <PASSWORD>
        instance.set_password(password)
        instance.save()

# !/usr/bin/python # -*- coding: utf-8 -*- Author: <NAME>     Contact: <EMAIL> or <EMAIL>     File: signals.py     Time: 2020/8/23 18:06     File Intro: