WebFaction
Community site: login faq

I've got Bottle working from my domain on the Web, using listening-on-port. The program is trivial, it just prints out a "not ready yet" message:

<module>
from bottle import route, run
@route('/')
def application():
    return 'Not ready yet'
run(port=51874)
<module>

Two issues:

(1) If I run the program with: python3.1 notready.py& it works fine, and returns control to my ssh session. But when I close my netbook or otherwise stop the session, the server stops. What's a good way to handle this?

(2) I also imported CherryPyServer, and changed the 'run' command to run(port=51874, server=CherryPyServer). It gives the following error. What should I do instead?

[replicounts@web214 htdocs]$ python3.1 notready.py
Bottle server starting up (using CherryPyServer())...
Listening on http://127.0.0.1:51874/
Use Ctrl-C to quit.

Traceback (most recent call last):
  File "notready.py", line 7, in <module>
    run(port=51874, server=CherryPyServer)
  File "/home/replicounts/webapps/repc/htdocs/bottle.py", line 2302, in run
    server.run(app)
  File "/home/replicounts/webapps/repc/htdocs/bottle.py", line 2037, in run
    from cherrypy import wsgiserver
ImportError: No module named cherrypy
[replicounts@web214 htdocs]$

asked 13 Nov '11, 20:03

replicounts
123
accept rate: 0%

edited 13 Nov '11, 22:14


  1. Use the 'nohup' utility or daemon mode on the framework. If you open an app in SSH and its not a daemon than it will expect SSH to stay open.

  2. What does the full line(s) of code look like before and after?

permanent link

answered 13 Nov '11, 20:50

johns
5.4k312
accept rate: 23%

Thanks -- nohup works fine:

nohup python3.1 notready.py &

Note: I edited the question, to show lines correctly in the program, and in the execution with errors.

Still need to learn how to run Bottle with the CherryPy server.

(13 Nov '11, 22:31) replicounts
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×97
×32
×9

question asked: 13 Nov '11, 20:03

question was seen: 2,905 times

last updated: 13 Nov '11, 22:31

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM