scgi and Quixote 2.6
dream fish <[email protected]> Wed, 6 May 2009 17:58:37 +0800
| Newsgroups | gmane.comp.web.quixote.user |
|---|---|
| Message-ID | <[email protected]> |
i'm new to python and quixote. i've installed
apache2.2.11+python2.5.2+quixote2.6+scgi1.13 on my computer(i use fedora10),
but i've met a problem:
i read the article "A Quixote Application:Getting
Started<http://www.rexx.com/%7Edkuhlman/quixote_appgetgo.html>",
and put the simpliest example code on my computer, the code files are:
myapp/scgi-server.py
myapp/ui/__init__.py
myapp/ui/servicesui.py
but i couldn't run it successfully.
i run ./scgi-server.py -p 3000 -l logfile.log
then, in the logfile i found "AttributeError: 'str' object has no attribute
'_q_traverse'", and i searched it, there's an answer(
http://mail.mems-exchange.org/durusmail/quixote-users/4570/), but it's not i
want, i only want to use the publish.py on my computer, don't want to go
back to publish1, i'd rather change the code. so, how should i write the
scgi-server.py file?
here is my current scgi-server.py:
#!/usr/bin/python
from scgi.quixote_handler import QuixoteHandler, main
from quixote.publish import Publisher
from quixote import enable_ptl
enable_ptl()
class MyAppHandler(QuixoteHandler):
publisher_class = MyPublisher
root_namespace = "myapp.ui"
prefix = ""
if __name__ == '__main__':
main(MyAppHandler)
i also test a script which was running successfully. but i wonder, is that
too simply, what if i want to write my own Publisher.
the script is as follows(tand he whole only two files: testtest.ptl, the
script below):
#!/usr/bin/python
from scgi.quixote_handler import QuixoteHandler, main
from quixote import enable_ptl
from quixote.publish import Publisher
enable_ptl()
def create_publisher():
from testtest import RootDirectory
return Publisher(RootDirectory(), display_exceptions="plain")
if __name__ == "__main__":
from quixote.server import scgi_server
scgi_server.run(create_publisher, port=3000, script_name="")
please give me some advice. waiting for help, thank you.
_______________________________________________
Quixote-users mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/quixote-users