0
我在嘗試使用apache設置我的python項目後出現內部服務器錯誤。這條線有什麼問題SyntaxError:處理WSGI腳本發生異常來自item-catalog導入應用程序的SyntaxError作爲應用程序
from item-catalog import app as application
但是,如果我改變它,它也不起作用。
import app as application
工作。我的文件夾結構是
/var/www/html/itemcatalog/item-catalog
這是我itemcatalog.wsgi文件
#!/usr/bin/python
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/html/itemcatalog")
from item-catalog import app as application
application.secret_key = 'kGTdasfdasfdsa'
這是Apache錯誤日誌:
在他們[Tue Dec 13 02:12:09.149063 2016] [:error] [pid 29155:tid 139672369694464] [client 108.49.103.204:53087] mod_wsgi (pid=29155): Exception occurred processing WSGI script '/var/www/html/itemcatalog/item-catalog/itemcatalog.wsgi'.
[Tue Dec 13 02:12:09.149155 2016] [:error] [pid 29155:tid 139672369694464] [client 108.49.103.204:53087] File "/var/www/html/itemcatalog/item-catalog/itemcatalog.wsgi", line 7
[Tue Dec 13 02:12:09.149202 2016] [:error] [pid 29155:tid 139672369694464] [client 108.49.103.204:53087] from item-catalog import app as application
[Tue Dec 13 02:12:09.149244 2016] [:error] [pid 29155:tid 139672369694464] [client 108.49.103.204:53087] ^
[Tue Dec 13 02:12:09.149283 2016] [:error] [pid 29155:tid 139672369694464] [client 108.49.103.204:53087] SyntaxError: invalid syntax