News for hackers. Stuff that matters.
Re:Why should bottlepy stick to a file? by rambojazz on Sunday January 12, 2020 @03:29PM (#22029071)

    test.py
    =======
    import bottle
    
    @bottle.get('/')
    def index():
        return 'INDEX'
    
    # a new wsgi app
    hello = bottle.Bottle()
    
    @hello.get('/<name>')
    def greet(name):
        return 'Hello, ' + name
    
    bottle.app().mount('/hello', hello)
Test like this: python3 -m bottle --bind :8080 test

You should have 2 working routes, "/" and "/hello/<name>".

Re:Why should bottlepy stick to a file? by e12e on Sunday January 12, 2020 @06:15PM (#22030402)
Thanks, that makes sense.

But I'm still not clear on how I require "example.py" and mount it (ie how do I make an wsgi instance from a python file that is a bottle app)?