# my scgi_server.py
#!/usr/bin/python
from quixote.publish import Publisher
from quixote import enable_ptl
enable_ptl()
def create_publisher():
from root 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='')
yes, this works, but i still have some questions:
1.seems like i must put the scgi_server.py and root.ptl in the same folder,
otherwise it complains can't find module, so i can't put my code in
multi-folders like
myapp/scripts/scgi_server.py, mapp/ui/__init__.py, mapp/ui/root.ptl
(i did changed "from root import RootDirectory" to "from myapp.ui.root
import RootDirectory" and it complained "ImportError: No module named
myapp.ui", what else should i do?)
2.is it necessary to use "QuixoteHandler"? and how?
On Thu, May 7, 2009 at 8:48 AM, Neil Schemenauer wrote:
>
> If you want to use SCGI, check back with this list if you need help.
> Basically you can change:
>
> from quixote.server.simple_server import run
> print 'creating demo listening on http://localhost:8080/'
> run(create_publisher, host='localhost', port=8080)
>
> to:
>
> from quixote.server.scgi_server import run
> run(create_publisher, port=3000)
>
> Regards,
>
> Neil
>