For me the following view function gives the same error: def dummy_login(request): u = User.objects.create_user('dummy','','dummy') p = UserProfile() p.user = u p.save() u.save() print 'before auth',u.id u = authenticate(username='dummy',password='dummy') print 'is authenticated?',u.is_authenticated() print 'after auth',u.id print 'in profile user id is', p.user.id p = u.get_profile() return HttpResponse('done') ------------------------------ Console output is: before auth 9 is authenticated? True after auth 9 in profile user id is 9
Any ideas? Looks like profile object instance is not saved in the database even though i did p.save() E. On Nov 7, 6:46 am, paulc <[EMAIL PROTECTED]> wrote: > I'm trying to follow the example in the Django book, to make a simple > extension of the standard User object. > > I'm hoping someone may be able to give me a quick yes or no on this: > is the AUTH_PROFILE_MODULE setting expected to work with Django 0.96, > or do I need to upgrade to the SVN release? I have a couple of sites on 0.96 where it's been working without a problem. > > Within a very simple view that I'm using just to try this out, I can > pick up the User object and access some of its fields (e.g. username) > and custom methods (e.g. is_authenticated); but if I call the > get_profile() method, I see the following error: > > Exception Type: AttributeError > Exception Value: 'NoneType' object has no attribute > '_default_manager' > > I'm pretty sure I have AUTH_PROFILE_MODULE set correctly (I do not get > the `too many values to unpack' error). > > I do not see the SiteProfileNotAvailable error, which again seems to > suggest I have all the necessary middleware and settings present in > the configuration. Actually, it would help if you would paste here your AUTH_PROFILE_MODULE setting as well as your profile model class. Also, what Django app name does this profile model live under? -- View this message in context: http://www.nabble.com/AUTH_PROFILE_MODULE-usable-with-v0.96--tf4764214.html#a13687613 Sent from the django-users mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---