I am trying to get dynamic apps running in virtualenv's.
I've followed the direction here: 
http://projects.unbit.it/uwsgi/wiki/DynamicVirtualenv

Currently I'm running a very simple test case behind cherokee.
I've created my virtualenv as such: virtualenv /opt/uwsgi/apps/test
I created a simple wsgi script in 
/opt/uwsgi/apps/test/lib/python2.6/site-packages/testapp.py (per 
http://answerpot.com/showthread.php?662402-Virtual+Hosting+question):

    def application(environ, start_response):
        start_response('200 OK', [('Content-Type', 'text/plain')])
        yield 'Hello There!!!\n'


My XML config is: 

    <uwsgi>
      <pidfile>/var/run/uwsgi.pid</pidfile>
      <socket>/tmp/uwsgi.sock</socket>
      <chmod-socket>666</chmod-socket>
      <no-site/>
      <daemonize>/var/log/uwsgi.log</daemonize>
      <processes>4</processes>
      <master/>
      <harakiri>20</harakiri>
      <limit-as>128</limit-as>
      <listen>128</listen>
      <socket-timeout>10</socket-timeout>
      <buffer-size>8192</buffer-size>
      <max-vars>128</max-vars>
      <single-interpreter/>
      <sync-log/>
    </uwsgi>


I've set the following handler environment variables in cherokee:

    UWSGI_PYHOME /opt/uwsgi/apps/test
    UWSGI_SCRIPT testapp


Here is what I see in the log:

    *** Starting uWSGI 0.9.6.5 (64bit) on [Tue Dec  7 17:46:28 2010] ***
    ***
    *** You are running a DEBUG version of uWSGI, plese disable DEBUG in 
uwsgiconfig.py and recompile it ***
    ***
    compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-48)
    Python version: 2.6.6 (r266:84292, Nov  1 2010, 23:55:51) 
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]
    writing pidfile to /var/run/uwsgi.pid
    limiting address space of processes...
    your process address space limit is 134217728 bytes (128 MB)
    your memory page size is 4096 bytes
     *** WARNING: you have enabled harakiri without post buffering. Slow upload 
could be rejected on post-unbuffered webservers *** 

    allocated 640 bytes (0 KB) for 1 request's buffer.
    binding on UNIX socket: /tmp/uwsgi.sock
    [uWSGI DEBUG] uwsgi socket SO_RCVBUF size: 65535
    [uWSGI DEBUG] uwsgi socket SO_SNDBUF size: 65535
    your server socket listen backlog is limited to 128 connections
    initializing hooks...done.
    spawned uWSGI master process (pid: 32122)
    spawned uWSGI worker 1 (pid: 32123)
    spawned uWSGI worker 2 (pid: 32124)
    spawned uWSGI worker 3 (pid: 32125)
    spawned uWSGI worker 4 (pid: 32126)
    [uWSGI DEBUG] uwsgi payload size: 1111 (0x457) modifier1: 0 modifier2: 0
    [uWSGI DEBUG] SERVER_NAME=latte.milkncoffee.com
    [uWSGI DEBUG] PATH_INFO=/
    [uWSGI DEBUG] SCRIPT_NAME=/test
    ImportError: No module named testapp
    [pid: 32123|app: -1|req: -1/1] 10.196.202.224 () {64 vars in 1111 bytes} 
[Tue Dec  7 17:46:29 2010] GET /test/ => generated 46 bytes in 0 msecs 
(HTTP/1.1 
500) 2 headers in 63 bytes (0 async switches on async core 0)


However, as the cherokee user I can cd to /opt/uwsgi/apps/test and 'source 
bin/activate' to do this:

    >>> import testapp
    >>> testapp.application
    <function application at 0x7fdb154ebb18>


Any advice would be appreciated.

Thanks,

Ty


      
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to