1

I am trying to integrate Django-Facebook with an app already using Django-Userena for user accounts. When I try to visit "/accounts/edit" when logged in through Facebook, however, I am not able to edit any of the existing information. If I am logged in through Userena, however, I am able to edit existing information. Can anyone help me understand why? I think that I have followed the Django-Facebook instructions...

models.py:

class Profile(UserenaBaseProfile, FacebookProfileModel):
    user = models.OneToOneField(User,
                                unique=True,
                                verbose_name=('user'),
                                related_name='my_profile')
    website = models.URLField(null=True, blank=True)
    zipcode = models.IntegerField(max_length=5, null=True, blank=True)

    def __unicode__(self):
        return self.user.username

    def create_facebook_profile(sender, instance, created, **kwargs):
        if created:
            Profile.objects.create(user=instance)

    post_save.connect(create_facebook_profile, sender=User)

settings.py:

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.static',
    'django.core.context_processors.media',
    'django.core.context_processors.i18n',
    'django.core.context_processors.debug',
    'django_facebook.context_processors.facebook',
    'django.core.context_processors.request',
    'django.contrib.messages.context_processors.messages',
)
AUTH_PROFILE_MODULE = 'myapp.Profile'
AUTHENTICATION_BACKENDS = (
    'userena.backends.UserenaAuthenticationBackend',
    'guardian.backends.ObjectPermissionBackend',
    'django_facebook.auth_backends.FacebookBackend',
    'django.contrib.auth.backends.ModelBackend',
)
FACEBOOK_REGISTRATION_BACKEND = 'django_facebook.registration_backends.UserenaBackend' 
karthikr
  • 97,368
  • 26
  • 197
  • 188
Nick B
  • 9,267
  • 17
  • 64
  • 105

0 Answers0