Hi,
What version of django-registration are you using? I assume 0.7
The usage of profile_callback has been removed in 0.8, a very recent
release actually, looking at the codebase history.
The finer documentation on the usage of 0.8 is made available at:
http://docs.b-list.org/django-registration/0.8/
What you are looking for was originally provided for in django-
profiles, which integrated nicely with django-registration.
However, the way to go now is to create a new app, add your user
profile class there, and connect to the
registration.signals.user_registered signal.
Small example:
models.py (in myapp)
from django.db import models
from registration.signals import user_registered
from django.dispatch import receiver
class MySuperDuperUserProfile(models.Model):
user = models.ForeignKey(User)
whatever = models.CharField(max_length=100)
wherever = models.CharField(max_length=50)
@receiver(user_registered)
def create_superduper_user_profile(sender, **kwargs):
new_user = kwargs.pop('user', None)
data_dict_from_registration_form = kwargs.pop('request',
None).POST
sdup = MySuperDuperUserProfile()
sdup.user = new_user
sdup.whatever = data_dict_from_registration_form['whatever']
sdup.wherever = data_dict_from_registration_form['wherever']
sdup.save()
That's all folks. No messing around with existing code. You can create
a custom registration form in which you add your profile fields, that
you pass to the registration view via de url, and get the form fields
from the request that also gets sent to the
create_superduper_user_function. Please note I did not run this sample
code, so some bugs certainly will be there.
HTH
Cheers
> > > >
https://bitbucket.org/ubernostrum/django-registrationaversion but i