This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from registration.signals import user_activated | |
from django.contrib.auth import login, authenticate | |
def login_on_activation(sender, user, request, **kwargs): | |
"""Logs in the user after activation""" | |
user.backend = 'django.contrib.auth.backends.ModelBackend' | |
login(request, user) | |
# Registers the function with the django-registration user_activated signal | |
user_activated.connect(login_on_activation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import asyncore | |
import email.header | |
import email.parser | |
import smtpd | |
def decodeHeader (value): | |
return email.header.make_header(email.header.decode_header(value)) |