python - error in inserting image in Webpy -


i new @ python, want insert image in html. first have tried static page concept web.reloder doesn't works. shows error after have tried following code still not desired output

import web  urls = ('/', 'hello')  app = web.application(urls, globals())  class hello:     def get(self):         return """<html><body><img src="images.jpg"></body></html>"""  if __name__ == "__main__":     app.run() 

i'm not sure web.reloader talking about, here's how use static files.

create directory static script runs. then, put images.jpg static.

in html, change image tag <img src="/static/images.jpg. web.py knows retrieve image.

so better visualization of whole directory this:

project    |    |-- main.py    |    |-- static           |           |-- images.jpg 

okay, since rather new, let off question asked searched online easily. go google-fu , search static files webpy. , this , this.

please, @ least try search next time.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -