How do I serve static files with the web.py server?

Asked by Eleanor Berger

How do I serve static files such as JavaScripts or images like PNG and JPG with the web.py server?

Question information

Language:
English Edit question
Status:
Solved
For:
web.py Edit question
Assignee:
No assignee Edit question
Solved by:
Eleanor Berger
Solved:
Last query:
Last reply:
Revision history for this message
Best Eleanor Berger (intellectronica) said :
#1

Create a directory (also known as a folder) called static in the location of the script that runs the web.py server. Then place the static files you wish to server in the static folder.

For example, the URL http://localhost/static/logo.png will send the image ./static/logo.png to the client.