from gluon.main import HttpServer
server = HttpServer(ip,port,admin_password)
server.start()

On Aug 22, 3:03 pm, Stef Mientki <[email protected]> wrote:
>  hello,
>
> I just tried to run Web2Py_CC, (that's the best name I could think of for my 
> editor ;-)
> on Ubuntu and Fedora, and most of the things works quit well.
> One of the problems I encounter is launching of the web2py server.
>
> Launching the server under windows works perfect through the web2py exe-file)
> For launching the server in Linux,
> from within a python program,
> the only thing I can think of,
> is the use of execfile().
>
> As I run web2py.py from the command line, it runs ok.
>
> The following program, doesn't work
> filename = r'P:/Web2Py/web2py_src/web2py/web2py.py'
> import os
> os.chdir ( os.path.split ( filename)[0] )
> print os.getcwd()
> execfile ( filename )
>
> and gives the following error message:
> Traceback (most recent call last):
>   File "D:\Data_Python_25\support\test.py", line 21, in <module>
>     execfile ( filename )
>   File "P:/Web2Py/web2py_src/web2py/web2py.py", line 16, in <module>
>     import gluon.import_all
> ImportError: No module named gluon.import_all
>
> Now if I add the web2py path to the python system path, I get the following 
> error
> (it looks to me that the web2py_path is not very well derived)
> Traceback (most recent call last):
>   File "D:\Data_Python_25\support\test.py", line 26, in <module>
>     execfile ( filename )
>   File "P:/Web2Py/web2py_src/web2py/web2py.py", line 17, in <module>
>     import gluon.widget
>   File "P:/Web2Py/web2py_src/web2py\gluon\widget.py", line 28, in <module>
>     import main
>   File "P:/Web2Py/web2py_src/web2py\gluon\main.py", line 63, in <module>
>     version_info = open(os.path.join(web2py_path, 'VERSION'), 'r')
> IOError: [Errno 2] No such file or directory: 
> 'D:\\Data_Python_25\\support\\VERSION'
>
> If try subprocess.Popen,
> import subprocess
> Params = 'python ' + filename + ' -i localhost -v -D 0 -a "aap"'
> subprocess.Popen ( Params )
>
> I get the following error:
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.81.5 (2010-07-22 23:56:21)
> Database drivers available: pysqlite2, MSSQL/DB2
> Starting hardcron...
> DEBUG:root:WEB2PY CRON: Acquiring lock
> DEBUG:root:WEB2PY CRON: Releasing cron lock
> please visit:
>        http://localhost:8000INFO:root:Hardcron daemon started
>
> use "kill -SIGTERM 2024" to shutdown the web2py server
> INFO:root:starting web server...
> INFO:root:SSL is off
> INFO:root:SSL is off
> DEBUG:Rocket.Errors.ThreadPool:Initializing ThreadPool.
> INFO:Rocket.Errors.ThreadPool:Starting Rocket 1.0.6
> DEBUG:Rocket.Errors.ThreadPool:This platform does not support signals.
> DEBUG:Rocket.Errors.ThreadPool:Starting threads.
> DEBUG:Rocket.Errors.Thread-4:Entering main loop.
> DEBUG:Rocket.Errors.Thread-5:Entering main loop.
> DEBUG:Rocket.Errors.Thread-10:Entering main loop.
> DEBUG:Rocket.Errors.Thread-6:Entering main loop.
> DEBUG:Rocket.Errors.Thread-11:Entering main loop.
> DEBUG:Rocket.Errors.Thread-12:Entering main loop.
> DEBUG:Rocket.Errors.Thread-3:Entering main loop.
> DEBUG:Rocket.Errors.Thread-8:Entering main loop.
> DEBUG:Rocket.Errors.Thread-7:Entering main loop.
> DEBUG:Rocket.Errors.Thread-9:Entering main loop.
> DEBUG:Rocket.Monitor:Entering monitor loop.
> DEBUG:Rocket.Monitor:In "receive timed-out connections" loop.
> INFO:Rocket.Errors.ThreadPool:Listening on sockets: localhost:8000
> INFO:Rocket.Errors.ThreadPool:Stopping Server
> DEBUG:Rocket.Errors.ThreadPool:Stopping threads.
> DEBUG:Rocket.Monitor:Received a death threat.
> DEBUG:Rocket.Errors.Thread-6:Received a death threat.
> DEBUG:Rocket.Errors.Thread-5:Received a death threat.
> DEBUG:Rocket.Errors.Thread-8:Received a death threat.
> DEBUG:Rocket.Monitor:Flushing waiting connections
> DEBUG:Rocket.Errors.Thread-3:Received a death threat.
> DEBUG:Rocket.Errors.Thread-9:Received a death threat.
> DEBUG:Rocket.Errors.Thread-11:Received a death threat.
> DEBUG:Rocket.Errors.Thread-10:Received a death threat.
> DEBUG:Rocket.Errors.Thread-12:Received a death threat.
> DEBUG:Rocket.Errors.Thread-7:Received a death threat.
> DEBUG:Rocket.Errors.Thread-4:Received a death threat.
> DEBUG:Rocket.Monitor:Flushing queued connections
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-4.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-5.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-10.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-6.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-11.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-3.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-12.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-8.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-7.
> DEBUG:Rocket.Errors.ThreadPool:Removing dead thread: Thread-9.
>
> any sugestions ?
> thanks,
> Stef Mientki

Reply via email to