Reputation: 367
Hello I'm having a problem displaying a picture in web2py. I know it similar to writing HTML code for some reason the picture doesn't appear. Maybe its a syntax error or maybe I've been looking at the code for to long to tell.
Upvotes: 0
Views: 247
Reputation: 25536
web2py doesn't serve URLs like that. See the book section on dispatching. The URL must specify an application, controller, and function (and optionally args and/or vars), and the function should retrieve and return the requested file. For details, see the book section on uploads as well as the download()
function in the scaffolding app.
The only exception is for files in the /static
folder within the application -- they can be served directly via URLs like /myapp/static/path/to/file.ext
. If pic.png is a static file, then you should put it in the /static
folder.
Upvotes: 1