AG
socket
Size: a a a
AG
socket
KV
socket
AG
KV
def send_activation_notification(user):
if ALLOWED_HOSTS:
host = 'http://' + ALLOWED_HOSTS[0] + ':8000'
else:
host = 'http://localhost'
context = {'user': user, 'host': host,
'sign': signer.sign(user.username)}
subject = render_to_string('email/activation_letter_subject.txt', context)
body_text = render_to_string('email/activation_letter_body.txt', context)
user.email_user(subject, body_text)
AG
def send_activation_notification(user):
if ALLOWED_HOSTS:
host = 'http://' + ALLOWED_HOSTS[0] + ':8000'
else:
host = 'http://localhost'
context = {'user': user, 'host': host,
'sign': signer.sign(user.username)}
subject = render_to_string('email/activation_letter_subject.txt', context)
body_text = render_to_string('email/activation_letter_body.txt', context)
user.email_user(subject, body_text)
KV
def user_registrated_dispatcher(sender, **kwargs):
send_activation_notification(kwargs['instance'])
AG
def send_activation_notification(user):
if ALLOWED_HOSTS:
host = 'http://' + ALLOWED_HOSTS[0] + ':8000'
else:
host = 'http://localhost'
context = {'user': user, 'host': host,
'sign': signer.sign(user.username)}
subject = render_to_string('email/activation_letter_subject.txt', context)
body_text = render_to_string('email/activation_letter_body.txt', context)
user.email_user(subject, body_text)
crum
: добавляется middleware и у тебя всегда есть возможность достать requestAG
def user_registrated_dispatcher(sender, **kwargs):
send_activation_notification(kwargs['instance'])
KV
AG
N
KV
А
AG
Ꮆ
А
Ꮆ
AG
А
R