login db and templates