Question

I had no issue with Django + uWSGI + Cherokee. BUt I would like to try pylons before committing to either framework.

I followed the tutorial from pylonshq.com - 1.0/gettingstarted

I ran into no problems when running pylons with paste.

So I used instructions to run pylons with uWSGI from projects.unbit.it - uwsgi/wiki/UsePaste

This is the source interpreter line I used with Cherokee (connection 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

My vServer in Cherokee is bokken.test.com with root directory: /var/www/pylons/example/example/public (I've tried with and without trailing slash)

My "Directory /" rule handler is set to the uWSGI source, but no root directory is set for the specific handler.

When I visit bokken.test.com, I get a redirect loop error.

Google Chrome:

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.

Error.log:

*** 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)

Unlike Django, none of the tutorials I found specify a uwsgi.xml or .wsgi script. I'm not sure what needs to change.

Was it helpful?

Solution

You say that you've set the file root of the Cherokee vServer to the /example/public directory of your Pylons project. That seems likely to be a problem - Pylons looks in the public directory for files to serve before attempting to match a controller, so you're setting yourself up for future issues there. The root folder of the Pylons app should probably be where you point the vServer at, and let Pylons handle its own chunk of the directory tree.

Also, you will definitely need a .wsgi script - the last bit of your question implies that you don't have one? It's a little confusing - please clarify.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top