刚才我用mercurial将我的远程回购从服务器克隆到电脑上。
我更改了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"
我的服务器上一切正常。为什么在localhost中出现这种情况?
--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