Hey there, Now im working this base on dmitko tutorial on extending django-registration post, all went out fine, just the i can't received the user_registered signal properly.
forms.py
from django import forms
from registration.forms import RegistrationForm
from models import UserProfile
class UserProfileForm(RegistrationForm):
fullname = forms.CharField(max_length=200)
address = forms.CharField(max_length=200)
urls.py
from django.conf.urls.defaults import *
from registration.views import register
from forms import UserProfileForm
import regbackend
urlpatterns = patterns('',
url(r'^accounts/register/$', register, {'backend': 'registration.backends.default.DefaultBackend','form_class': UserProfileForm}, name='registration_register'),
(r'^accounts/', include('registration.backends.default.urls')),
)
regbackend.py
from forms import UserProfileForm
from models import UserProfile
def user_created(sender, user, request, **kwargs):
form = UserProfileForm(request.POST)
data = UserProfile(user=user)
data.fullname = form.cleaned_data["fullname"]
data.address = form.cleaned_data["address"]
print "USER CREATED SIGNALS!"
data.save()
from registration.signals import user_registered
user_registered.connect(user_created)
print "REGBACKEND!"
I can get all them working fine but I can't get my signal to connect properly to my user_created method. The print method are just a way for me to check the codes. Can't get user_created to print "USER CREATED SIGNALS!".
Any thoughts??