use Context(... autoescape=False) instead of |safe all over the place.