Thanks Graham for the heads up on Flask. This is what I have been looking for.
On Tue, Nov 8, 2011 at 10:46 PM, Graham Dumpleton <[email protected]> wrote: > On 9 November 2011 17:21, Richard Rouse <[email protected]> wrote: >> Hi Graham, >> >> To test whether I configured wgsi, I used the script from the >> QuickConfigurationGuide - >> http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide >> >> I sort of read the discussions, copied what was done in this message:: >> http://www.mail-archive.com/[email protected]/msg01518.html > > Why didn't you follow through with the configuration example described > in the configuration guide rather than using some obscure mailing list > post from years back? > >> So basically I edited Apache to include this virtual host: >> >> <VirtualHost *:80> >> ServerAdmin webmaster@localhost >> DocumentRoot /var/www/ >> WSGIScriptAlias /foobar /var/www/aj/cgi-bin/foobar/baz.py >> CustomLog /var/log/apache2/access.log combined >> ErrorLog /var/log/apache2/error.log >> LogLevel info >> </VirtualHost> >> >> I installed mod_wsgi-3.3. >> >> I moved this baz.py script out of cgi-bin and it works fine. Just >> can't figure out how to get an app to run through apache > > The key thing is the 'application' function or object. That is the > WSGI application entry point. For the example at: > > http://webpython.codepoint.net/wsgi_request_parsing_get > > You would have just dropped off the lines at the bottom, ie., delete: > > httpd = make_server('localhost', 8051, application) > # Now it is serve_forever() in instead of handle_request(). > # In Windows you can kill it in the Task Manager (python.exe). > # In Linux a Ctrl-C will do it. > httpd.serve_forever() > > You could also have removed from start: > > from wsgiref.simple_server import make_server > > Those lines are only relevant if running from command line. > > Put the remained in the WSGI script file in place of the hello world > you already had. > > If you are only new at this I would recommend against doing it from > scratch. You could use Pyramid, but an easier option is Flask. > > So try Flask. Importantly, use its built in development server > initially while you learn stuff, don't try and go straight to hosting > it with mod_wsgi. > > 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. > > -- Richard Rouse HTS Resources, LLC. 325 W. Washington St. #2-150 San Diego, CA 92103 USA 619-846-8291 [email protected] www.htsresources.com -- 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.
