5
我想我的部署应用程序瓶的一个mod_wsgi的Apache的烧瓶中的应用程序,但我有麻烦,因为阿帕奇试图解决一些在文件系统中的路线:部署与mod_wsgi的
Apache的error_log中:
[Mon Aug 06 19:18:38 2012] [error] [client ::1] File does not exist:
/srv/http/webchat/src/_publish_message, referer: http://localhost:88/webchat/chat
我说“的一些路线”,因为验证(“/”)和重定向到“/聊天”的作品。
路线 “_publish_message” 经由AJAX访问这样的(使用jQuery):
function publish_message(e){
e.preventDefault();
$.post('/_publish_message', {'message': "user's message taken from a text field"})
.fail(Handler.publish_error);
}
路线 “_sse_stream” 被用作URL用于EventSource的。
这两个都不行!
虚拟主机配置:
<VirtualHost *:88>
ServerName webchat.dev
WSGIDaemonProcess webchat user=http group=http threads=5
WSGIScriptAlias /webchat /srv/http/webchat/src/webchat.wsgi
WSGIScriptReloading On
DocumentRoot /srv/http/webchat/src
<Directory /srv/http/webchat/src>
WSGIProcessGroup webchat
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
的webchat.wsgi
文件:
import sys
sys.path.insert(0, '/srv/http/webchat/src')
from index import app as application
一个基本的 “Hello World” 应用程序部署到mod_wsgi
运行正常。 当使用集成到烧瓶中的开发服务器运行时,我的烧瓶应用表现良好。
“路由 ”_publish_message“ 通过AJAX访问”。你能提供更多细节吗? – codegeek 2012-08-07 02:51:14
我添加了执行AJAX请求的代码。 – Paul 2012-08-07 07:54:09
我不确定,但可能会有所帮助。 http://flask.pocoo.org/docs/patterns/jquery/ – codegeek 2012-08-07 14:15:00