Skip to content Skip to sidebar Skip to footer

How To Start Bottle As A Daemon From Another Script?

I would like to use BottlePy as a daemon started from another script and I have issues turning a standalone script (webserver.py) into a class. The standalone version of my webserv

Solution 1:

what kind of parameters am I expected to pass to hello() and error404()?

The short answer: none. Just remove self and they should start to work.

@bottle.get('/hello')
def hello():
    return 'Hello World'@bottle.error(404)
def error404(error):
    return 'error 404'

what should I do in order to parametrize @bottle.get('/hello')? I would like to have something like @bottle.get(hello_url) but where should hello_url = '/hello' be initialized? (self.hello_url is unknown to @bottle.get)

I can interpret this a couple of different ways, so I'm not sure how to help you. But since this is a completely separate question (with potentially a much larger scope), please consider asking it in a new, separate SO question.

Post a Comment for "How To Start Bottle As A Daemon From Another Script?"