2010/5/24 m <[email protected]>:
> Hello all,
>
> Brand new to web.py, so if this is a stupid question, apologies in
> advance.
>
> I have an existing cgi program that I'm interested in migrating to
> wsgi & web.py.
>
> As a first step, I've done this:
>
>  import web
>
>  class MainApp:
>
>      def GET(self):
>          sys.stderr.write("GET WAS CALLED\n")
>          return 'welcome to mdl'
>
>  urls = ('/~mark/wsgi/','MainApp')
>  app = web.application(urls,globals())
>  app.run()
>
> So, obviously, haven't gotten very far.  It works.  I point the
> browser to localhost on 8080 and I see "welcome to mdl"
>
> Now, ultimately, I want to deploy this with mod_wsgi on an apache
> server.  So, the next step was replacing app.run with application =
> app.wsgifunc() --- as you can probably guess, it doesn't work.
>
> The browser (chromium) just displays "Ooops, broken link".
> The main server error log file displays no messages.  But, it does if
> I sys.stderr.write to it, so there truly is nothing going there.  The
> virtual host error log  file (set to info) has:
>
> [Mon May 24 09:53:13 2010] [info] [client 192.168.1.53] mod_wsgi
> (pid=21365, process='', application='tigges.ca|/~mark/wsgi/mdl'):
> Reloading WSGI script '/home/mark/public_www/wsgi-bin/mdl'.
>
> And that's it!
>
> So,  not a lot to go on for what's going wrong.  I started copying and
> pasting all the code from the web.py application class into my python
> file to try to track down where it was going wrong.
>
> wsgifunc (with no middleware list) just returns the functional
> wsgi ... so I c&p'd that, and everything it calls.  Lots of
> sys.stderr.write debugging later, and I discover, that it's crashing
> on the call to isinstance at line 420 (web.py-0.30) in
> application._match.  The crash is that the 2nd parameter is not a
> class, type, or tuple of classes and types.  Rather, it's the function
> that was returned by wsgifunc.
>
> So ... that's my question.  What the hell am I doing wrong?

Looks like this is a  problem with apache configuration. I think,
/~mark/wsgi/ should go to the apache config and not in to the urls.
Your urls should just be:

urls = ('/', 'MainApp')

Can you show how you are using the WSGIScriptAlias?

Anand

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to