Django-registration ImportError: No module named signals
I am trying to write a signal listener for django-registration and I am getting the import error: no module named signals. But I could import registration.
Here is my code
from django.contrib.auth import login
from registration.signals import user_registered
def user_registered_handler(sender, **kwargs):
"""signal intercept for user_login"""
user = kwargs['user']
user.is_active =开发者_高级运维 True
user.save()
login(user)
user_registered.connect(user_registered_handler)
-- Thanks in advance.
Try using a specific path to version 0.8. I noticed that using easy install and pip installed 0.7 which does not have signals.py.
Using pip:
$ pip install -Iv https://bitbucket.org/ubernostrum/django-registration/downloads/django-registration-0.8-alpha-1.tar.gz
精彩评论