Made changes to the view to use Django's template system.