vendredi 6 janvier 2017

Serving an img with bottle

I'm having difficulty getting an image to display in my bottle app.

My folder structure is:

project|
    --|views
    --|controllers
    --|static
        --|img
              --myimage
    --|models

On the client side I've told it to place an image with:

 <img href="/static/img/myimage.png" ALT="example annotation" WIDTH=500 HEIGHT=300>

And on the server side I've used:

@app.route('/static/<filename:path>')
def static(filename):
     return static_file(filename, root='static/')

As per the bottle docs, but I still can't get the image to load.




Aucun commentaire:

Enregistrer un commentaire