[Twisted-web] Turkey Questions 1-5

lloyd at paisite.com lloyd at paisite.com
Thu Jul 7 14:03:31 MDT 2005


I've changed the thread from "Re: Introduction, newbie confusion plus an
offer" to "Turkey Questions 1-5" to start the Q&A.

Goal: Create the world's simplest web-server

My first set of questions are based on "Configuring and Using the
Twisted.Web Server in "Twisted.Web Documentation."

Inspired by the section "Installing a pre-configured server," I did the

-- created the directory ~/twisted/www
-- created the file ~/twisted/www/myHTML.html

<title>flat html file</title>
<h1>Hello, World!</h1>

-- entered "mktap web --path ~/twisted/www --logfile ~/twisted/www --port
8080" into the command line
-- entered "twistd -f web.tap" into command line


-- System wrote the file "web.tap" into ~$, my home directory
-- System wrote twistd.log into ~/twisted/www
-- When I entered "http://localhost:8080/myHTML.html, my browser displayed
"Hello, World!"

OK, success.


1) Why did mktap write web.tap to my home directory rather than

2) Why didn't myHTML.html require a "Content-type: text/html" line?

3) How can I see the source for the server created by mktap?

4) Are there preferred practices for creating directories for the document
root (for instance, better in user or root), directories for resource
modules, site data, css styling, etc.?

5) Are there preferred practices for assigning permissions to files in the
above directories?

Best wishes,


More information about the Twisted-web mailing list