Hooked up the database for templates.