
roberto at unbit
Feb 5, 2010, 6:08 AM
Post #2 of 2
(255 views)
Permalink
|
On Fri, 2010-02-05 at 14:51 +0100, Dino Krtanjek wrote: > Hello. > > I've managed to set up my first django app using uWSGI with cherokee, > after trying all day. It was a real pain in the butt, but it's working > now. > > The problem I had was that uwsgi wouldn't work when I started cherokee > from the admin panel. Everything worked fine if I started uwsgi in a > terminal myself with the command "/usr/bin/uwsgi -s 127.0.0.1:60234 -t > 10 -M -p 1 -C -x /path/to/uwsgi.xml". Cherokee served the django > welcome page and all was good. Then I terminated the uwsgi process and > refreshed the page. Cherokee started a new uwsgi process, but the > django page wasn't the same. It gave a ImportError from django. I > figured I don't know much about python, and even less about django, so > I didn't read the error repport...big mistake. > > I couldn't figure out what the heck went wrong. After a few hours of > unsuccessful trial and error, I started to read the django error page > and right there at the beginning was something that caught my > attention: "Python Executable: /usr/share/cherokee/admin/". It > didn't make sense that the python executable that django was using (if > that's what "Python Executable" stands for) has something to do with > the cherokee admin interface. So I terminated uwsgi and stopped the > Cherokee server and cherokee-admin. Then I started cherokee again, but > this time from the command line, and django worked again. > > So, I don't know if this is a bug or no, but I figured I should tell > you guys about it. It's kind of stupid that I can't start cherokee > from the admin interface, because that interferes with django. Also, I > don't know if someone reported this problem before. Can we expect a > fix soon? > > Cherokee has always been rock solid and just plain awesome. It's a > great project and I'm a big fan. Thanks for the great work. > > PS: I'm using the latest 0.99.42 release. Hi Dino, this has nothing to do with cherokee or uWSGI. It is a PYTHONPATH problem/behaviour. By default the python environment add the current working directory to the pythonpath. Obviously it will change based on where the cwd is (probably in your home if you start uwsgi manually, or in the /admin of cherokee if you start from it) The "Python Executable var", is used by the python environment to build the cwd, so it is normally to have it pointing to a directory (if it is a file, the file-part will be removed in the search path) It is an important python skill to understand the PYTHONPATH: http://www.stereoplex.com/2009/mar/3/understanding-imports-and-pythonpath/ -- Roberto De Ioris http://unbit.it JID: roberto [at] jabber _______________________________________________ Cherokee-dev mailing list Cherokee-dev [at] lists http://lists.octality.com/listinfo/cherokee-dev
|