Python django facebook内部代码表示它可以';找不到facebook\u id

Python django facebook内部代码表示它可以';找不到facebook\u id,python,django,facebook,django-facebook,Python,Django,Facebook,Django Facebook,我遵循了django facebook的教程和示例 我已经启动并运行了它(就像我运行syncdb和迁移一样,并将javascript和css代码集成到我的模板中) 当我点击模板中的链接时,它成功连接到Facebook,我可以授权。但是,当它重定向时,我得到一个错误: Request Method: POST Request URL: http://127.0.0.1:8000/facebook/connect/?facebook_login=1 Django Version: 1.5.1

我遵循了django facebook的教程和示例

我已经启动并运行了它(就像我运行syncdb和迁移一样,并将javascript和css代码集成到我的模板中)

当我点击模板中的链接时,它成功连接到Facebook,我可以授权。但是,当它重定向时,我得到一个错误:

Request Method: POST
Request URL:    http://127.0.0.1:8000/facebook/connect/?facebook_login=1
Django Version: 1.5.1
Exception Type: AttributeError
Exception Value:    user or profile didnt have attribute facebook_id
Exception Location: /usr/local/lib/python2.7/dist-packages/django_facebook/utils.py in get_user_attribute, line 109
Python Executable:  /usr/bin/python
Python Version: 2.7.3
这是django facebook的代码,我不确定我的设置是否有问题。我已经创建了自己的UserProfile模型,它扩展了抽象的FacebookProfileModel类(我也尝试过使用FacebookModel):


我可以看到在db中创建的配置文件,尽管它都是空的(外键中使用的用户id除外)。不确定我做错了什么,有什么建议吗?

我发现了什么地方出了问题,想把解决方案发回去。问题是我没有在我的settings.py中指定AUTH_PROFILE_模块。在django facebook文档中,当它提供扩展profile类的选项时,没有提到这一点,所以我错过了它。愚蠢的错误

检查
FacebookProfileModel
的数据库模型是否正确创建。(如果您在运行syncdb后添加了此模型,您是否必须运行向南迁移?)请您确切地告诉我您在settings.py中添加了什么,因为我有相同的问题,对不起。在我的设置应用程序中,我做到了:AUTH_PROFILE_MODULE='appName.UserProfile',在这里,您将用您所调用的应用程序和配置文件类来替换appName和UserProfile。应用程序名应为django_facebook或存在UserProfile模型的应用程序?存在UserProfile模型的应用程序
from django_facebook.models import FacebookProfileModel
from django.db.models.signals import post_save

class UserProfile(FacebookProfileModel):
    user = models.OneToOneField('auth.User')

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

post_save.connect(create_profile, sender=User)