django-facebook not inserting facebook data to the models -


i have installed django-facebook in working application creating lots of problems. have followed installation of django-facebook here have not been able implement properly.

in facebook/example when try connect facebook, prompts user facebook credentials it's not able redirect next page getting following error:

user or profile didn't have attribute facebook_id

i did manage.py syncdb facebook attributes remain 'null' in db after connecting facebook in facebook/example.

i have added following code in documentation:

account/model.py

from django.db import models django.contrib.auth.models import user django.db.models.signals import post_save django_facebook.models import facebookprofilemodel  class user_info(facebookprofilemodel):     user_id = models.foreignkey(user)     dob = models.datefield(blank=true, null=true)     contact = models.integerfield(max_length=20, blank=true, null=true)     avatar = models.imagefield(upload_to='user_images', default='user_images/root.jpeg', null=true, blank=true)  def create_facebook_profile(sender, instance, created, **kwargs):     if created:         user_info.objects.create(user_id=instance)  post_save.connect(create_facebook_profile, sender=user) 

settings.py

installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', 'account', 'django_facebook', )  template_context_processors =( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.core.context_processors.request', 'django_facebook.context_processors.facebook', )  authentication_backends = ( 'django_facebook.auth_backends.facebookbackend', 'django.contrib.auth.backends.modelbackend',)  facebook_app_id = 'xxxxxxxxxxxxx' facebook_app_secret = 'xxxxxxxxxxxxxx' 

urls.py

urlpatterns = patterns('', url(r'^accounts/login/$',  login, {'template_name': 'login.html'}), url(r'^accounts/logout/$', logout, {'next_page': '/accounts/login/'}, name='auth_logout',), url(r'^accounts/signup/$', account.views.register, name='signup'), url(r'^facebook/', include('django_facebook.urls')), ) 

please me on this. thanks.

did specify auth_profile_module in settings.py ? try put:

   auth_profile_module = "yourapp.user_info" 

then syncdb , create facebook account. should trick.


Comments