Ok, figured out why the error was happening. It was because I had uwsgi 0.9.5 and it had a paste bug. Installing 0.9.5.1 fixed this.<div><br></div><div>Unfortunately turns out that Paste (1.7.4) assumes that there is a SCRIPT_NAME key (even if the value is "") and otherwise raises an exception for any URL that isn't /. If I use --paste for uwsgi and don't supply a SCRIPT_NAME in nginx, it breaks. So I reverted back to the DynamicApps setup with my wsgi wrapper that removes the extraneous slash.<div>
<br></div><div>I still can't figure out why the logger configuration isn't being setup at all, though.<br><br></div><div>(Also, looks like I might have accidentally hijacked another thread somehow. Apologies if that is the case.)</div>
<div><br></div><div>- Andrey</div><div><br><div class="gmail_quote">On Sat, Jul 3, 2010 at 6:02 PM, Andrey Petrov <span dir="ltr"><<a href="mailto:shazow@gmail.com">shazow@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="arial, helvetica, sans-serif">Do you really need dynamic apps ?<br>
<br>
To run pylons apps you can simply use:<br><br></font><div class="im">
<a href="http://projects.unbit.it/uwsgi/wiki/UsePaste" target="_blank"><font face="arial, helvetica, sans-serif">http://projects.unbit.it/uwsgi/wiki/UsePaste</font></a></div></blockquote><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif">I tried to set this up using the --paste flag, but I still get "wsgi application not found". </font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif">Here's my uwsgi command:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div></div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif">uwsgi -s /tmp/uwsgi.sock -H /var/lib/wsgi/ --paste config:/var/lib/wsgi/src/myproject/staging.ini \</font></div>
<div><font face="arial, helvetica, sans-serif">--uid 33 --gid 33 -M --pythonpath /var/lib/wsgi/src/myproject --pythonpath /var/lib/wsgi</font></div></div></blockquote><div class="gmail_quote"><div>
<font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I tried various combinations of --pythonpath (with and without and pointing to different places like /var/lib/wsgi/lib/python-2.6/site-packages and such).</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">And the nginx configuration is simply:</font></div><div><font face="arial, helvetica, sans-serif"><div>
<br></div><div> location / {</div><div class="im"><div> uwsgi_pass unix:///tmp/uwsgi.sock;</div></div><div> include uwsgi_params;</div><div> }</div><div><br></div><div>
Is there anything obvious I'm missing?</div>
<div><br></div><div>Also another problem I've encountered is that my logging configurations in the .ini are not being respected when I run through uwsgi (as opposed through paster). For example, in the staging.ini, I have a logger that I define to write through RotatingFileHandler that I call explicitly with every request inside of the application but it's not getting written when running through uwsgi. Any thoughts on this?</div>
<div><br></div><div>Excerpt from staging.ini:</div><div><br></div></font></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif"><div>
<div><div><div>[loggers]</div><div>keys = root, history</div></div><div><br></div><div>...</div><div><br></div><div>[logger_history]</div><div>level = DEBUG</div><div>handlers = history</div><div>qualname = history</div>
</div>
<div><br></div><div>[handler_history]</div></div></font></div></div><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif"><div><div>class = handlers.RotatingFileHandler</div></div>
</font></div></div><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif"><div><div>args = ('/var/lib/wsgi/src/myproject/history.log','a', 20000000, 10)</div></div>
</font></div></div><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif"><div><div>level = NOTSET</div></div></font></div></div><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif"><div>
<div>formatter = simpler</div></div></font></div></div></blockquote><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif"><div><br></div><div>Thank you again and I'm looking forward to your polishing of the nginx uwsgi params interface (re SCRIPT_NAME). :)</div>
<div><br></div><font color="#888888"><div>- Andrey</div></font></font></div></div>
</blockquote></div><br></div></div>