Graham Dumpleton
graham.dumpleton at gmail.com
Thu Jun 19 06:23:32 EDT 2008
2008/6/19 Andre Hübner <andre.huebner at gmx.de>: > Hello, > > thanks. It is working now. I had to install some more python-packages from > my distribution, they do a kind of micro-packaging... ;) > > changed Code: > > def index(): > s = """\ > <html> > <body> > <h2>Hello World!</h2> > </body> > </html> > """ > return s > > is working without changing setup. Just one step in correct direction. But > one problem still occurs > > http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.006.htp > If i use PythonHandler helloworld i got error ImportError: No module named > helloworld > Is helloworld a module which has to be installed? I did not found anything > in sources or unrpmed packages, i use Suse 10.1 > Do you are able to explain? Sorry, im new to this issue and trying to > lern... Please don't reply to me in person, use 'reply-all' and reply to the mailing list. As I said before, read the documentation. Specifically the documentation at: http://www.modpython.org/live/current/doc-html/ I don't know why you keep referring to the FAQ rather than main documentation. If you follow through the documentation slowly, step by step, it should explain things. Also, read: http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking It may help you to understand the difference. Ie., rather than use 'mptest' you use 'helloworld' in name of file, you will have same result, where you are defining your own handler. Graham > Thank you > Andre > > > ----- Original Message ----- From: "Graham Dumpleton" > <graham.dumpleton at gmail.com> > To: "Andre Hübner" <andre.huebner at gmx.de> > Cc: <mod_python at modpython.org> > Sent: Thursday, June 19, 2008 10:43 AM > Subject: Re: [mod_python] 404 error on existing file > > > Read documentation again. > > You are trying to use a standard mod_python handler code with higher > level publisher handler mechanism. You can't do that they are two > distinct things and have different ways of doing things. > > Also use Google to search for 'mod_python tutorial' and read the > tutorial you find. > > Graham > > 2008/6/19 Andre Hübner <andre.huebner at gmx.de>: >> >> Hi List, >> >> it is my first posting to mod_python mailinglist. >> I successfully solved problem with " make_obcallback: could not import >> mod_python.apache" using faq but now i need your help. >> .so File was ok, but i forgot to put *py Files to site-packages/mod_python >> ;) >> >> mod_python seems to run now. >> http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.006.htp shows >> what >> i try. >> I activated in httpd.conf: >> >> <Location "/py/"> >> AddHandler mod_python .py >> PythonHandler mod_python.publisher >> PythonDebug On >> </Location> >> >> My File in $document-root/py/test.py: >> >> from mod_python import apache >> >> def handler(req): >> req.content_type = "text/plain" >> req.send_http_header() >> req.write("Hello World! Blarg!") >> return apache.OK >> >> If I call this file i got apache-error 404, but called file is existing. >> in >> Apache errorlog i see: >> >> [Thu Jun 19 09:40:31 2008] [notice] mod_python (pid=18650, >> interpreter=example.com'): Importing module '/path/path/py/test.py' >> >> If i change code of test.py to make syntaxerror without changing >> apache-setup i see in errorlog and browser the message about syntaxerror. >> I cannot explain this 404 when using correct code. I just want to see >> "hello >> world" in browser. >> >> I use apache 2.2.9 and mod_python 3.3.1 >> What could be the problem? I hope there is somebody with experience in >> this >> case. >> >> Thank you >> Andre >> >> _______________________________________________ >> Mod_python mailing list >> Mod_python at modpython.org >> http://mailman.modpython.org/mailman/listinfo/mod_python >> > >
|