0

我想将 Pyfacebook 与 django 1.5 一起使用。我遵循本教程http://agiliq.com/blog/2009/02/how-to-build-a-facebook-app-in-django/

当我输入:'facebook.djangofb.FacebookMiddleware'MIDDLEWARE_CLASSES(settings.py)中。我收到此消息:发生服务器错误。请联系管理员。

Traceback (most recent call last):
  File "c:\Python27\lib\wsgiref\handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "c:\Python27\lib\site-packages\django\contrib\staticfiles\handlers.py", l
ine 72, in __call__
    return self.application(environ, start_response)
  File "c:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 236, i
n __call__
    self.load_middleware()
  File "c:\Python27\lib\site-packages\django\core\handlers\base.py", line 59, in
 load_middleware
    mw_instance = mw_class()
  File "build\bdist.win32\egg\facebook\djangofb\__init__.py", line 511, in __ini
t__
    self.secret_key = secret_key or settings.FACEBOOK_SECRET_KEY
  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 54, in __ge
tattr__
    return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'FACEBOOK_SECRET_KEY'

我尝试在 settings.py 中添加 FACEBOOK_SECRET_KEY 但我有同样的错误

谢谢

4

1 回答 1

0

最后我添加

FACEBOOK_SECRET_KEY = 'xxxxxxxx'
FACEBOOK_API_KEY = 'xx'

在 settings.py 中,它可以工作。

多谢你们

于 2013-06-28T12:26:35.230 回答