django-registration 0.8 signal not working -


Hey there, now im expanding to dmitko tutorial working on this basis, all have been okay, Can not just get me the User_registered signal properly

forms.py

  From registration to django import forms Import the model from the registration import from the certificate import from the certificate UserProfile class UserProfileForm (RegistrationForm): fullname = forms.CharField (Max_length = 200) address = forms.Charfield (max_length = 200)  

urls.py Import from registrar import import from django.conf.urls.defaults import * from import user profile file import regbackend urlpatterns = pattern ('', url (r '^ accounts / register / $' Register, 'Backend': 'Registration. Backend Default Default Backend', 'Form_class': UserProfileForm}, name =' registrati ('Registration.backends.default.urls')),)

regbackend.py

  User-generated user profile (sender, user, request, ** quorz): form = user profile file (request.post) data = user profile (user = user) data. Full name = form.cluited_data [" FULNNA "] data Address = form.cleaned_data ["address"] print "USER CREATED SIGNALS!" Data.save () registration.signals Import from user_registered user_registered.connect (user_created) Print "REGBACKEND!"  

I can do all of them right, but I can not get my signal to connect properly to my user friendly way. The print method is one way to check the code for me "Usernate can not be used to print the signals created by the user!".

Any ideas ??

The signal listener should be launched before calling the signal - before entering a signal Try importing ragbackend.py in models.py - If this work begins then there will be a clue about the solution.

Also do not use print, instead use the built-in python module in Python. You can either run debugging sessions with either. IPDB to see if the signal is received and if the user is created, then you can write simple unit-test or angel to verify it.


Comments