2011-05-27 41 views
0

剛纔我克隆我的遠程回購從我的服務器到我的電腦與mercurial。Django - 錯誤社會registration.middleware

我改變settings.py了一套sqlite3的數據庫引擎,我試圖運行的Django內置的Web服務器:

$ python manage.py runserver 
Validating models... 

0 errors found 
Django version 1.3, using settings 'myproj.settings' 
Development server is running at http://127.0.0.1:8000/ 
Quit the server with CONTROL-C. 
Traceback (most recent call last): 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 283, in run 
    self.result = application(self.environ, self.start_response) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__ 
    return self.application(environ, start_response) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 250, in __call__ 
    self.load_middleware() 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware 
    raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) 
ImproperlyConfigured: Error importing middleware socialregistration.middleware: "No module named facebook" 
[26/May/2011 22:22:54] "GET/HTTP/1.1" 500 959 
Traceback (most recent call last): 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 283, in run 
    self.result = application(self.environ, self.start_response) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 68, in __call__ 
    return self.application(environ, start_response) 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 250, in __call__ 
    self.load_middleware() 
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware 
    raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) 
ImproperlyConfigured: Error importing middleware socialregistration.middleware: "No module named facebook" 

一切都是我的服務器就OK了。爲什麼在本地主機?

- UDPATE

安裝pyfacebook和固定它。現在,我得到這個錯誤來訪/

Environment: 


Request Method: GET 
Request URL: http://127.0.0.1:8000/ 

Django Version: 1.3 
Python Version: 2.7.1 
Installed Applications: 
['django.contrib.auth', 
'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.sites', 
'django.contrib.messages', 
'django.contrib.staticfiles', 
'django.contrib.admin', 
'myapp', 
'avatar', 
'socialregistration'] 
Installed Middleware: 
('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.middleware.csrf.CsrfViewMiddleware', 
'django.middleware.csrf.CsrfResponseMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware', 
'socialregistration.middleware.FacebookMiddleware') 


Traceback: 
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 
    89.      response = middleware_method(request) 
File "/Users/fredcollins/Desktop/myproj/socialregistration/middleware.py" in process_request 
    23.   fb_user = facebook.get_user_from_cookie(request.COOKIES, 

Exception Type: AttributeError at/
Exception Value: 'module' object has no attribute 'get_user_from_cookie' 

回答

2

你忘了你的服務器上安裝facebook

+0

然後記得做一個'syncdb' – 2011-05-27 03:30:56

+0

在我的服務器上一切正常。問題在於本地。 – 2011-05-27 14:43:08

+0

但是,我已經安裝了它,請檢查我的新更新。 – 2011-05-27 14:46:29