2013-11-01 80 views
0

即時通過webfaction設置一個django項目,並且在所有配置網站顯示200錯誤之後。在Apache錯誤日誌這是信息:在webfaction上設置django的Apache錯誤

[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] mod_wsgi (pid=803732): Target WSGI script '/home/hammad/webapps/gccfishing/gccFishing/gccFishing/gccFishing/wsgi.py' cannot be loaded as Python module. 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] mod_wsgi (pid=803732): Exception occurred processing WSGI script '/home/hammad/webapps/gccfishing/gccFishing/gccFishing/gccFishing/wsgi.py'. 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] Traceback (most recent call last): 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] File "/home/hammad/webapps/gccfishing/gccFishing/gccFishing/gccFishing/wsgi.py", line 27, in <module> 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1]  from django.core.wsgi import get_wsgi_application 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] File "/home/hammad/webapps/gccfishing/lib/python2.7/site-packages/django/core/wsgi.py", line 1, in <module> 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1]  from django.core.handlers.wsgi import WSGIHandler 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] File "/home/hammad/webapps/gccfishing/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 4, in <module> 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1]  import logging 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python3.2/logging/__init__.py", line 26, in <module> 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1]  import sys, os, time, io, traceback, warnings, weakref 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] File "/home/hammad/webapps/gccfishing/lib/python2.7/warnings.py", line 107 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1]  except _OptionError, msg: 
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1]      ^
[Fri Nov 01 15:04:38 2013] [error] [client 127.0.0.1] SyntaxError: invalid syntax 

任何人都可以請幫忙嗎?

回答

0

得到它的工作。該錯誤是由於python版本之間不匹配造成的。 webfaction上的mod_wsgi應用程序在python 3上運行,我的應用程序使用python 2.7。

用python2.7重新創建了一個新的mod_wsgi應用程序,現在所有東西都在運行。

+0

請接受這個答案,以便讀者知道這個問題已經回答,而不必自己閱讀答案。 – EWit

+0

2天必須通過,只有我可以接受。 –