Re: [jToolkit-users] Problems with hello world
Brought to you by:
davidfraser,
friedelwolff
From: David F. <da...@sj...> - 2003-10-14 08:27:09
|
Greenbeard wrote: >Hello there > >I am running Win2k, Python 2.2, on Apache2 , mod_py >3.0.1 > >I extracted the archive to site-packages and changed >the httpd.conf as shown in your homepage. I get: >----------------------------------------------- >Mod_python error: "PythonHandler jToolkit.web" > >Traceback (most recent call last): > > File "C:\Python22\Lib\mod_python\apache.py", line >335, in HandlerDispatch > result = object(req) > > File >"C:\Python22\Lib\site-packages\jToolkit\web\__init__.py", >line 72, in handler > instance = getattr(module, instancename) > >AttributeError: 'module' object has no attribute >'HelloWorldConfig' > >----------------------------------------------- >Here is httpd.conf > > <Directory "C:/Program Files/Apache >Group/Apache2/htdocs/jtoolkit"> >SetHandler python-program >PythonHandler jToolkit.web >PythonOption jToolkit.module jToolkit.demo.helloworld >PythonOption jToolkit.instance HelloWorldConfig >PythonDebug On > ></Directory> > > >TIA, > >gb400 > > Hi Thanks for reporting this, this shouldn't happen, but hopefully we'll be able to track it down... I have attached a modified version of jToolkit\web\__init__.py (this is now in jToolkit CVS). You should be able to save it over the __init__.py in C:\Python22\Lib\site-packages\jToolkit\web\__init__.py This should give you a more detailed error message saying which attributes are present in the imported module: Mod_python error: "PythonHandler jToolkit.web" Traceback (most recent call last): File "/usr/local/python22nothreads/lib/python2.2/site-packages/mod_python/apache.py", line 193, in Dispatch result = object(req) File "/share/sjsoft/code/jSuite.py/jToolkit/web/__init__.py", line 84, in handler server = getserver(modulename, instancename) File "/share/sjsoft/code/jSuite.py/jToolkit/web/__init__.py", line 69, in getserver raise AttributeError("module %r has no attribute %r\nmodule is %r, attributes are %r" % (modulename, instancename, module, dir(module))) AttributeError: module 'jToolkit.demo.helloworld' has no attribute 'HelloWorldConfIg' module is <module 'jToolkit.demo.helloworld' from '/share/sjsoft/code/jSuite.py/jToolkit/demo/helloworld.pyc'>, attributes are ['HelloWorldConfig', 'HelloWorldServer', '__builtins__', '__doc__', '__file__', '__name__', 'server', 'widgets'] Python path is ['/share/sjsoft/code/jSuite.py/', '/usr/local/python22nothreads/lib/python2.2/', '/usr/local/python22nothreads/lib/python2.2/site-packages'] Something else that might be helpful is to try the following from python: from jToolkit.demo import helloworld dir(helloworld) print helloworld.HelloWorldConfig Let me know the results you find! Thanks for helping to test the package Regards David PS Soon jToolkit should have the ability to run in a standalone mode without mod_python or Apache, which should make testing and initial setup easier |