0

我对 Django + uWSGI + Cherokee 没有意见。但是我想在提交任一框架之前尝试 pylons。

我遵循了 pylonshq.com - 1.0/gettingstarted 的教程

我在运行带有粘贴的塔架时没有遇到任何问题。

所以我使用了来自 projects.unbit.it - uwsgi/wiki/UsePaste 的指令来运行带有 uWSGI 的 pylons

这是我与 Cherokee 一起使用的源解释器行(连接 127.0.0.1:5000):

uwsgi -s 127.0.0.1:5000 --paste config:/var/www/pylons/example/development.ini -H /var/www/pylons/ -M

我在 Cherokee 中的 vServer 是 bokken.test.com,其根目录为:/var/www/pylons/example/example/public(我尝试过使用和不使用斜杠)

我的“目录/”规则处理程序设置为 uWSGI 源,但没有为特定处理程序设置根目录。

当我访问 bokken.test.com 时,我收到重定向循环错误。

谷歌浏览器:

The webpage at http://bokken.test.com// has resulted in too many redirects (Notice the extra slash).
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

错误日志:

*** Starting uWSGI 0.9.5.4 (32bit) on [Sat Aug  7 19:01:51 2010] ***
compiled with version: 4.4.3
Python version: 2.6.5 (r265:79063, Apr 16 2010, 13:28:26) 
[GCC 4.4.3]
your memory page size is 4096 bytes
allocated 372 bytes (0 KB) for 1 request's buffer.
Setting PythonHome to /var/www/pylons/...
binding on TCP port: 5000
your server socket listen backlog is limited to 64 connections
initializing hooks...done.
Loading paste environment: config:/var/www/pylons/example/development.ini
application 0 (/) ready
setting default application to 0
spawned uWSGI master process (pid: 1278)
spawned uWSGI worker 1 (pid: 1280)
[pid: 1280|app: 0|req: 1/1] 192.168.0.198 () {52 vars in 926 bytes} [Sat Aug  7 19:01:55 2010] GET / => generated 433 bytes in 7 msecs (HTTP/1.1 301) 2 headers in 95 bytes (0 async switches on async core 0)

与 Django 不同,我找到的教程都没有指定 uwsgi.xml 或 .wsgi 脚本。我不确定需要改变什么。

4

1 回答 1

0

您说您已将 Cherokee vServer 的文件根目录设置为 Pylons 项目的 /example/public 目录。这似乎是一个问题 - Pylons 在尝试匹配控制器之前会在公共目录中查找要服务的文件,因此您正在为将来的问题做好准备。Pylons 应用程序的根文件夹可能应该是您将 vServer 指向的位置,并让 Pylons 处理它自己的目录树块。

此外,您肯定需要一个 .wsgi 脚本 - 您问题的最后一点暗示您没有脚本?这有点令人困惑 - 请澄清。

于 2010-11-03T17:37:18.773 回答