Factor out DB name.
Don't use sqlite3-specific cursor shortcut.
To support any DB module, just catch any exception thrown during sql exec.

DBAPI 2.0 actually standardize exception hierarchy of DBAPI module,
but it yet to be seen if it's implemented correctly everywhere.
http://www.python.org/dev/peps/pep-0249/#exceptions
Refactor to support different DB types/modules (by example of sqlite3 & PgSQL).
Allow to serve arbitrary pages from html/ subdir.