On 3 May 2007 at 21:25, drag sidious wrote:
> class Root(object):
>
> def welcome(self, name):
> return 'Hello %s!' % name
>
> 2007-05-03 21:17:32 : GET /scripts/welcome
> MultiDict([('name', 'asdf')]) feilds
> <type 'instance'> feilds type
> <__main__.Root object at 0xb79c684c> obj
So you see obj is the root instance, not a bound method in this case.
I think adding some print statements find_obj will tell you what's going on.
I think SCRIPT_NAME or PATH_INFO from the scgi server is not the same as
from the built-in http server, and find_object is just getting confused and
returning
self.root, rather than returning self.root.welcome
I think you should print out environ, I'm sure that will give you the clue.
> TypeError: __call__() got an unexpected keyword argument 'name'
Right, because Root.__call__ doesn't take an arg called "name"
> <bound method Root.welcome of <__main__.Root object at 0xb79aa84c>> obj
see, find_object has returned the result of
getattr(obj, next)
where next == 'welcome'
> The only difference I see is the 'bound method' line. But I have no clue
> what that is or what or why it's different.
print environ in find_object, look at PATH_INFO and SCRIPT_NAME for
differences.
> Is there a different way to get this stuff working with SCGI or FastCGI?
Maybe your flup is out of date? I have used scgi via lighttd, no problems
I use just paste, paste-deploy and pastescript.
Not sure if any of the below will help.
--
my lighttpd.conf
server.port = 8080
server.modules = ( "mod_access",
"mod_scgi"
)
server.document-root = "/tmp"
server.error-handler-404 = "/dispatch.scgi"
server.errorlog = "/tmp/lighttpd.error.log"
accesslog.filename = "/tmp/access.log"
scgi.debug = 0
scgi.server = ( "/" =>
( "127.0.0.1" =>
(
"host"=>"127.0.0.1",
"port"=>9080,
"check-local" => "disable",
"disable-time" => 1
)
)
)
--
the .ini I pass to paste-script, in part
[server:main]
use = egg:PasteScript#flup_scgi_thread
# Change to 0.0.0.0 to make public:
host = 127.0.0.1
port = 9080
--
python2.4
>>> import flup
>>> help(flup)
Help on package flup:
NAME
flup
FILE
/usr/local/lib/python2.4/site-packages/flup-0.5-py2.4.egg/flup/__init__.py
PACKAGE CONTENTS
middleware (package)
publisher
resolver (package)
server (package)
--
Brad Clements, [EMAIL PROTECTED] (315)268-1000
http://www.murkworks.com
AOL-IM or SKYPE: BKClements
_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users