Set up the db and template