1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
5 This is a resource file that renders a static web page.
7 To test the script, rename the file to hello.rpy, and move it to any directory,
8 let's say /var/www/html/.
10 Now, start your Twisted web server:
11 $ twistd -n web --path /var/www/html/
13 And visit http://127.0.0.1:8080/hello.rpy with a web browser.
16 from twisted.web import static
22 <HTML><HEAD><TITLE>Hello Rpy</TITLE>
24 <H1>Hello World, It is Now %(now)s</H1>
30 d += "<LI>%(i)s" % vars()
38 resource = static.Data(d, 'text/html')