Note, have cc'd this back to mod_wsgi list. If possible post followups there. See:
http://groups.google.com/group/modwsgi On 1 June 2010 05:13, Jason Caldwell <[email protected]> wrote: > Hi Graham -- > > As mentioned in a previous email --> love mod_python. However, as you > mentioned --> it's going away. > > So now I'm investigating your mod_wsgi module. The read-up sounds cool, > however my dilemma is two-fold: > > 1. I use Python 3 (for my CGI scripts -- works fantastic, but slow.) I want > to keep using Python 3.1.2, which segways into my second dilemma; Based on discussions I have seen I am dubious CGI will work completely on Python 3 as various of the Python standard library modules are broken for bytes/unicode as used in CGI. It may be the case that you aren't encountering these problems however. At the moment the suggestions is that this propagates into WSGI as well. This is in part why WSGI on Python 3 is still a bit of an unknown. > 2. I hate frameworks. They confuse me. Python's CGI functionality is > absolutely perfect without an annoying layer (sudo-language) above/between it. > > So, my question is: > Can I use mod_wsgi without the lame frameworks (CherryPy, Django, and so on)? Yes. The WSGI interface isn't that much different to CGI in capabilities. Instead of using os.environ you just use environ dictionary passed to application. You also need to ensure you clean up per request state and don't leave it around. If your code isn't multithread safe, you also need to ensure you use a configuration whereby single threaded process is used. What I suggest you do is read up about what the WSGI interface is and experiment with implementing directly on top of it. See: http://www.python.org/dev/peps/pep-0333/ http://code.google.com/p/modwsgi/wiki/SupportForPython3X http://www.wsgi.org/wsgi/Learn_WSGI > If not, is there a very *lightweight* version that works with Py3.1.2 that > you know of? Or does mod_wsgi provide it's own embedded framework which I > can use? The only lightweight framework that I know of that advertises itself as working with Python, including on top of mod_wsgi is bottle. See: http://bottle.paws.de/ http://bottle.paws.de/page/docs#apache-mod_wsgi > Recommendation/Suggestion: > I'm a seasoned PHP and Coldfusion programmer. Any chance you can can make a > mod_python2 and mod_python3 that allows Python to just be Python -- that is; > behave just like CGI but embedded? Similar idea to mod_php -- it just works, > no frameworks necessary. You really should just use WSGI. As I said, at the basic interface it isn't that much different. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
