ticket:3 tests
ticket:3 database and middleware implementation
ticket:3 view and template implementation
merged t1