我正在尝试在 Apache 后面使用带有 mod_wsgi 的 BottlePy。
应用程序.wsgi:
#!/usr/bin/python27
from bottle import route, default_app
from wbem.models import Host
@route('/')
def index():
return "Home Page"
os.chdir(os.path.dirname(__file__))
application = default_app()
但是,我似乎收到了这个错误:
mod_wsgi (pid=8850): Target WSGI script '/u/apps/wbem/app.wsgi' cannot be loaded as Python module.
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] mod_wsgi (pid=8850): Exception occurred processing WSGI script '/u/apps/wbem/app.wsgi'.
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] Traceback (most recent call last):
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] File "/u/apps/wbem/app.wsgi", line 2, in ?
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] from bottle import route, default_app
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] File "/usr/local/lib/python2.7/site-packages/bottle.py", line 113
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] return s.encode(enc) if isinstance(s, unicode) else bytes(s)
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] ^
[Wed Oct 30 09:35:17 2013] [error] [client 10.10.65.19] SyntaxError: invalid syntax
如果一些大师可以阐明一些光,将不胜感激:)