changed templates to support the new django syntax
cleaned some files