I tried to use uwsgi to setup wsgi processes in a cherokee webserver today.
I must say it was a significant challenge.
The cherokee webserver wanted me to use an XML configuration file (seems reasonable enough) except that my code was incompatible with that calling convention – because I did not call my wsgi application handler “Application”.
The installation for uwsgi did not want to load from my virtual environment, because – as it turns out – my binary download was compiled against a different version of python, but the error message said “no site.py found”
I have decided to share these notes, hoping to save someone else some time in tracking these problems down.
My 3 uwsgi – python app setup problems.
Problem 1) I needed to build uwsgi from source to be sure that my versions of python matched exactly.
the binary install – I used the first time was compiled to use python 2.7 while I was running 2.6.5
Here is how I found that out – Note the Python Version when starting up uWSGI.
Does it match what is in your virtualenv for your app.
*** Starting uWSGI 0.9.6.5 (64bit) on [Mon Oct 4 01:32:18 2010] ***
compiled with version: 4.4.3
Python version: 2.6.5 (r265:79063, Apr 16 2010, 14:15:55)
[GCC 4.4.3]
rather than this
*** Starting uWSGI 0.9.6.5 (64bit) on [Mon Oct 4 01:35:44 2010] ***
compiled with version: 4.4.3
Python version: 2.7 (r27:82500, Sep 18 2010, 10:48:25)
[GCC 4.4.3]
Problem 2) Setting My Virtual Environment Path with (-H) needs a full path
and when the versions of python do not match – it reports an error
but not an error about the python version mismatch
it simply states – unable to import site
it finally worked using my full path and matching versions of python
==========================================================
-H /http/seti/community/uwsgitest/htdocs/env2.6/
==========================================================
Problem 3) There is no way to specify the callable from the xml configuration file
<app mountpoint=”/”>
<module>wsgitestapp</module>
</app>
the Callable Name MUST be application – there is no attribute to specify the callable
it appears that you can only do that from the command line